Raumkommander commited on
Commit
d395597
·
1 Parent(s): a991bc1

inital deployment1

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -10,7 +10,8 @@ def video_stream():
10
  ret, frame = cap.read()
11
  if not ret:
12
  break
13
- yield frame
 
14
  cap.release()
15
 
16
  # Create Gradio App
@@ -18,7 +19,7 @@ with gr.Blocks() as demo:
18
  gr.Markdown("## 🎥 Webcam Stream with Output to a Separate Canvas")
19
 
20
  with gr.Row():
21
- webcam_feed = gr.Video(label="Live Webcam", streaming=True)
22
  canvas_output = gr.Image(label="Canvas - Output Stream")
23
 
24
  start_button = gr.Button("Start Streaming")
 
10
  ret, frame = cap.read()
11
  if not ret:
12
  break
13
+ frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
14
+ yield Image.fromarray(frame)
15
  cap.release()
16
 
17
  # Create Gradio App
 
19
  gr.Markdown("## 🎥 Webcam Stream with Output to a Separate Canvas")
20
 
21
  with gr.Row():
22
+ webcam_feed = gr.Video(label="Live Webcam")
23
  canvas_output = gr.Image(label="Canvas - Output Stream")
24
 
25
  start_button = gr.Button("Start Streaming")