Spaces:
Sleeping
Sleeping
SuperSecureHuman
commited on
Commit
·
3104fd0
1
Parent(s):
7b2a498
Update app.py
Browse files
app.py
CHANGED
@@ -10,14 +10,14 @@ model = load_model('./model.h5')
|
|
10 |
def predict_image(img):
|
11 |
img_4d = img.reshape(-1, 224, 224, 3)
|
12 |
prediction = model.predict(img_4d)[0]
|
13 |
-
return {class_names[i]: float(prediction[i]) for i in range(
|
14 |
|
15 |
|
16 |
class_names = ['Crescentia_Cujete', 'Fiddle_Wood', 'Gold_Apple', 'Hill_Mango', 'Indian_Tulip_Tree', 'Mahagony', 'Pala_Indigo_Plant', 'Spanish_Cherry', 'Teak', 'Yellow_Trumpet']
|
17 |
|
18 |
image = gr.inputs.Image(shape=(224, 224))
|
19 |
|
20 |
-
label = gr.outputs.Label(num_top_classes=
|
21 |
|
22 |
gr.Interface(fn=predict_image,
|
23 |
title="Tree Classification",
|
|
|
10 |
def predict_image(img):
|
11 |
img_4d = img.reshape(-1, 224, 224, 3)
|
12 |
prediction = model.predict(img_4d)[0]
|
13 |
+
return {class_names[i]: float(prediction[i]) for i in range(10)}
|
14 |
|
15 |
|
16 |
class_names = ['Crescentia_Cujete', 'Fiddle_Wood', 'Gold_Apple', 'Hill_Mango', 'Indian_Tulip_Tree', 'Mahagony', 'Pala_Indigo_Plant', 'Spanish_Cherry', 'Teak', 'Yellow_Trumpet']
|
17 |
|
18 |
image = gr.inputs.Image(shape=(224, 224))
|
19 |
|
20 |
+
label = gr.outputs.Label(num_top_classes=10)
|
21 |
|
22 |
gr.Interface(fn=predict_image,
|
23 |
title="Tree Classification",
|