Vivekan commited on
Commit
a6222a0
1 Parent(s): 968ba1f

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
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)