allencbzhang commited on
Commit
1265529
·
verified ·
1 Parent(s): d5e9ea0

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -0
app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ if __name__ == "__main__":
4
+ gr.close_all()
5
+
6
+ def inference(img, confidence):
7
+ print(type(img))
8
+ return img
9
+ # img = np.array(img)
10
+ # _, results = vis_demo.run_on_image(img, confidence)
11
+ return results
12
+
13
+ demo = gr.Interface(
14
+ fn=inference,
15
+ inputs=[
16
+ gr.Image(type="pil", image_mode="RGB"),
17
+ gr.Number(precision=2, minimum=0.0, maximum=1.0, value=0.5)
18
+ ],
19
+ outputs="image",
20
+ # examples=[
21
+ # ["assets/000000014226.jpg"],
22
+ # ["assets/000000028449.jpg"]
23
+ # ]
24
+ )
25
+ demo.launch(share=True, debug=False)