yourusername commited on
Commit
6306de6
β€’
1 Parent(s): 1cdde98

:sparkles: add streaming webcam

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +25 -2
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ”₯😎πŸ”₯
4
  colorFrom: blue
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 3.0.24
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
4
  colorFrom: blue
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 3.1.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -113,8 +113,31 @@ video_interface = gr.Interface(
113
  allow_screenshot=False,
114
  )
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  if __name__ == "__main__":
117
  gr.TabbedInterface(
118
- [video_interface, image_interface],
119
- ["Run on Videos!", "Run on Images!"],
120
  ).launch()
 
113
  allow_screenshot=False,
114
  )
115
 
116
+ webcam_interface = gr.Interface(
117
+ fn_image,
118
+ inputs=[
119
+ gr.Image(source='webcam', streaming=True),
120
+ gr.Slider(0, 1, value=0.5, label="Confidence Threshold"),
121
+ gr.Slider(0, 1, value=0.5, label="IOU Threshold"),
122
+ ],
123
+ outputs=gr.Image(type="file"),
124
+ live=True,
125
+ title="YOLOv6",
126
+ description=(
127
+ "Gradio demo for YOLOv6 for object detection on real time webcam. To use it, simply allow the browser to access"
128
+ " your webcam. Read more at the links below."
129
+ ),
130
+ article=(
131
+ "<div style='text-align: center;'><a href='https://github.com/meituan/YOLOv6' target='_blank'>Github Repo</a>"
132
+ " <center><img src='https://visitor-badge.glitch.me/badge?page_id=nateraw_yolov6' alt='visitor"
133
+ " badge'></center></div>"
134
+ ),
135
+ allow_flagging=False,
136
+ allow_screenshot=False,
137
+ )
138
+
139
  if __name__ == "__main__":
140
  gr.TabbedInterface(
141
+ [video_interface, image_interface, webcam_interface],
142
+ ["Run on Videos!", "Run on Images!", "Run on Webcam!"],
143
  ).launch()