Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import numpy as np
|
|
5 |
|
6 |
model = load_model('Pikachu_and_Raichu.h5')
|
7 |
|
8 |
-
|
9 |
|
10 |
def predict(img):
|
11 |
img=img.reshape(160,160,3)
|
@@ -13,10 +13,10 @@ def predict(img):
|
|
13 |
images_list.append(np.array(img))
|
14 |
x = np.asarray(images_list)"""
|
15 |
prediction = model.predict(img)[0]
|
16 |
-
return {
|
17 |
|
18 |
image = gr.inputs.Image(shape=(160, 160))
|
19 |
label = gr.outputs.Label(num_top_classes=2)
|
20 |
|
21 |
gr.Interface(fn=predict, inputs=image, title="Garbage Classifier",
|
22 |
-
description="
|
|
|
5 |
|
6 |
model = load_model('Pikachu_and_Raichu.h5')
|
7 |
|
8 |
+
labels = ['Pikachu', 'Raichu']
|
9 |
|
10 |
def predict(img):
|
11 |
img=img.reshape(160,160,3)
|
|
|
13 |
images_list.append(np.array(img))
|
14 |
x = np.asarray(images_list)"""
|
15 |
prediction = model.predict(img)[0]
|
16 |
+
return {labels[i]: float(prediction[i]) for i in range(len(labels))}
|
17 |
|
18 |
image = gr.inputs.Image(shape=(160, 160))
|
19 |
label = gr.outputs.Label(num_top_classes=2)
|
20 |
|
21 |
gr.Interface(fn=predict, inputs=image, title="Garbage Classifier",
|
22 |
+
description="Tradio.",outputs=label,interpretation='default').launch(debug=True,enable_queue=True)
|