MarcosRodrigo commited on
Commit
834b2a4
·
verified ·
1 Parent(s): f2c6803

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -21,10 +21,10 @@ def detect_faces(image):
21
  # Convert back to RGB for display
22
  return cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
23
 
24
- # Use gr.Video for webcam feed instead of gr.Image
25
  webcam_interface = gr.Interface(
26
  fn=detect_faces,
27
- inputs=gr.Video(source="webcam", streaming=True),
28
  outputs="image",
29
  title="Live Webcam Face Detection",
30
  description="Displays the live feed from your webcam and detects faces in real-time."
 
21
  # Convert back to RGB for display
22
  return cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
23
 
24
+ # Use gr.Video with live=True for live webcam feed
25
  webcam_interface = gr.Interface(
26
  fn=detect_faces,
27
+ inputs=gr.Video(streaming=True, live=True), # Use `live=True` instead of `source="webcam"`
28
  outputs="image",
29
  title="Live Webcam Face Detection",
30
  description="Displays the live feed from your webcam and detects faces in real-time."