harshitface2003 commited on
Commit
7408480
·
verified ·
1 Parent(s): 6aedf14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -9
app.py CHANGED
@@ -1,15 +1,20 @@
1
  import gradio as gr
 
2
 
3
- def webcam(video0,video1):
4
- return video0,video1
5
 
6
- interface = gr.Interface(
7
- fn=webcam,
8
- inputs=[gr.Webcam(mirror_webcam=False,streaming=True),
9
- gr.Webcam(mirror_webcam=True,streaming=True),
10
- ],
11
- outputs=["image","image"],
 
 
 
 
 
 
12
  )
13
 
14
  if __name__ == "__main__":
15
- interface.launch()
 
1
  import gradio as gr
2
+ from gradio_webrtc import WebRTC
3
 
 
 
4
 
5
+ with gr.Blocks() as demo:
6
+ image = WebRTC(label="Stream", mode="send-receive", modality="video")
7
+ conf_threshold = gr.Slider(
8
+ label="Confidence Threshold",
9
+ minimum=0.0,
10
+ maximum=1.0,
11
+ step=0.05,
12
+ value=0.30,
13
+ )
14
+ image.stream(
15
+ inputs=[image, conf_threshold],
16
+ outputs=[image], time_limit=10
17
  )
18
 
19
  if __name__ == "__main__":
20
+ demo.launch()