Abhi-22 commited on
Commit
b44bdba
·
verified ·
1 Parent(s): 4809422

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -29,7 +29,7 @@ with gr.Blocks() as demo:
29
  with gr.Row():
30
  with gr.Column(scale=2):
31
  # Main video feed
32
- video_feed = gr.Image(label="Live Camera Feed")
33
 
34
  with gr.Column(scale=1):
35
  # Status and results
@@ -66,8 +66,7 @@ with gr.Blocks() as demo:
66
  # Event handlers
67
  start_button.click(
68
  fn=start_detection,
69
- outputs=status_text,
70
- every=PROCESS_INTERVAL
71
  )
72
 
73
  # Process frames when detection is running
@@ -81,7 +80,7 @@ with gr.Blocks() as demo:
81
  stop_button.click(
82
  fn=stop_detection,
83
  outputs=status_text,
84
- cancels=[start_button, video_feed]
85
  )
86
 
87
  if __name__ == "__main__":
 
29
  with gr.Row():
30
  with gr.Column(scale=2):
31
  # Main video feed
32
+ video_feed = gr.Image(label="Live Camera Feed", streaming=True)
33
 
34
  with gr.Column(scale=1):
35
  # Status and results
 
66
  # Event handlers
67
  start_button.click(
68
  fn=start_detection,
69
+ outputs=status_text
 
70
  )
71
 
72
  # Process frames when detection is running
 
80
  stop_button.click(
81
  fn=stop_detection,
82
  outputs=status_text,
83
+ cancels=[video_feed]
84
  )
85
 
86
  if __name__ == "__main__":