0-ma commited on
Commit
192d452
·
verified ·
1 Parent(s): 641f366

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import skimage
3
+
4
+ labels = []
5
+ def predict(img):
6
+ img = PILImage.create(img)
7
+ pred,pred_idx,probs = detector.predict(img)
8
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
9
+
10
+ title = "Geometric Shape Classifier"
11
+ description = "A geometric shape setector."
12
+ examples = ['A.jpg']
13
+ interpretation='default'
14
+ enable_queue=True
15
+
16
+ gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,examples=examples,interpretation=interpretation,enable_queue=enable_queue).launch()