Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
def predict_image(img):
|
2 |
+
img_2d=img.reshape(-1,180,180,3)
|
3 |
+
prediction=model.predict(img_2d)[0]
|
4 |
+
return {class_names[i]: float(prediction[i]) for i in range(5)}
|
5 |
+
|
6 |
+
image = gr.inputs.Image(shape=(180,180))
|
7 |
+
label = gr.outputs.Label(num_top_classes=5)
|
8 |
+
|
9 |
+
gr.Interface(fn=predict_image, inputs=image, outputs=label,interpretation='default').launch(share=True)
|