Update app.py
Browse files
app.py
CHANGED
@@ -9,19 +9,19 @@ from tensorflow.keras.models import load_model
|
|
9 |
# load model
|
10 |
model = load_model('mmodel.h5')
|
11 |
|
12 |
-
classnames = ['Pikachu','Raichu','Pichu']
|
13 |
|
14 |
|
15 |
|
16 |
def predict_image(img):
|
17 |
img_4d=img.reshape(-1,224, 224,3)
|
18 |
prediction=model.predict(img_4d)[0]
|
19 |
-
return {classnames[i]: float(prediction[i]) for i in range(
|
20 |
|
21 |
|
22 |
|
23 |
image = gr.inputs.Image(shape=(224, 224))
|
24 |
-
label = gr.outputs.Label(num_top_classes=
|
25 |
|
26 |
|
27 |
gr.Interface(fn=predict_image, inputs=image, title="Garbage Classifier V3",
|
|
|
9 |
# load model
|
10 |
model = load_model('mmodel.h5')
|
11 |
|
12 |
+
classnames = ['Pikachu','Raichu','Pichu','Gyaradosu']
|
13 |
|
14 |
|
15 |
|
16 |
def predict_image(img):
|
17 |
img_4d=img.reshape(-1,224, 224,3)
|
18 |
prediction=model.predict(img_4d)[0]
|
19 |
+
return {classnames[i]: float(prediction[i]) for i in range(4)}
|
20 |
|
21 |
|
22 |
|
23 |
image = gr.inputs.Image(shape=(224, 224))
|
24 |
+
label = gr.outputs.Label(num_top_classes=4)
|
25 |
|
26 |
|
27 |
gr.Interface(fn=predict_image, inputs=image, title="Garbage Classifier V3",
|