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,7 +13,7 @@ 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)
|
|
|
5 |
|
6 |
model = load_model('Pikachu_and_Raichu.h5')
|
7 |
|
8 |
+
class_names = ['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 {class_ames[i]: float(prediction[i]) for i in range(len(class_names))}
|
17 |
|
18 |
image = gr.inputs.Image(shape=(160, 160))
|
19 |
label = gr.outputs.Label(num_top_classes=2)
|