xmrt commited on
Commit
477e5a7
·
1 Parent(s): 84fc022
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -58,7 +58,7 @@ description = """
58
  To use it, simply upload an image and enter comma separated text descriptions of objects you want to query the image for. You
59
  can also use the score threshold slider to set a threshold to filter out low probability predictions.
60
  """
61
- demo = gr.Interface(
62
  query_image,
63
  inputs=[gr.Image(source="upload"),
64
  "text",
@@ -66,6 +66,19 @@ demo = gr.Interface(
66
  outputs="image",
67
  title="Zero-Shot Object Detection with OWL-ViT",
68
  description=description,
69
- examples=[],
70
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  demo.launch()
 
58
  To use it, simply upload an image and enter comma separated text descriptions of objects you want to query the image for. You
59
  can also use the score threshold slider to set a threshold to filter out low probability predictions.
60
  """
61
+ upload = gr.Interface(
62
  query_image,
63
  inputs=[gr.Image(source="upload"),
64
  "text",
 
66
  outputs="image",
67
  title="Zero-Shot Object Detection with OWL-ViT",
68
  description=description,
69
+ examples=["./examples/IMGP0178.jpg"],)
70
+
71
+ web = gr.Interface(
72
+ query_image,
73
+ inputs=[gr.Image(source="webcam"),
74
+ "text",
75
+ gr.Slider(0, 1, value=0.1)],
76
+ outputs="image",
77
+ title="Zero-Shot Object Detection with OWL-ViT",
78
+ description=description,
79
+ examples=["./examples/IMGP0178.jpg"],)
80
+
81
+ demo = gr.TabbedInterface(interface_list=[upload, web],
82
+ tab_names=["From a File", "From your Webcam"])
83
+
84
  demo.launch()