Kuberwastaken commited on
Commit
aa4ff87
·
1 Parent(s): 3700a6a

Used gr.live for camera

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -206,13 +206,13 @@ def create_app():
206
  last_process_time = time.time() - 10
207
  processing_interval = 5
208
 
209
- with gr.Blocks(theme=gr.themes.Soft()) as app:
210
- gr.Markdown("# AsianMOM: Asian Mother Observer & Mocker")
211
  gr.Markdown("### Camera captures what you're doing and your Asian mom responds appropriately")
212
 
213
  with gr.Row():
214
  with gr.Column():
215
- video_feed = gr.Image(sources=["webcam"], streaming=True, label="Camera Feed")
216
 
217
  with gr.Column():
218
  analysis_output = gr.Textbox(label="What AsianMOM Sees", lines=2)
@@ -248,7 +248,7 @@ def create_app():
248
  return image, default_caption, default_roast, default_audio
249
 
250
  # Setup the processing chain
251
- video_feed.change(
252
  process_webcam,
253
  inputs=[video_feed],
254
  outputs=[video_feed, analysis_output, roast_output, audio_output]
 
206
  last_process_time = time.time() - 10
207
  processing_interval = 5
208
 
209
+ with gr.Blocks(theme=gr.themes.Monochrome()) as app:
210
+ gr.Markdown("# Artificial Surveillance with Interactive Analysis with a Nagging Maternal Oversight Model")
211
  gr.Markdown("### Camera captures what you're doing and your Asian mom responds appropriately")
212
 
213
  with gr.Row():
214
  with gr.Column():
215
+ video_feed = gr.Live(label="Camera Feed")
216
 
217
  with gr.Column():
218
  analysis_output = gr.Textbox(label="What AsianMOM Sees", lines=2)
 
248
  return image, default_caption, default_roast, default_audio
249
 
250
  # Setup the processing chain
251
+ video_feed.stream(
252
  process_webcam,
253
  inputs=[video_feed],
254
  outputs=[video_feed, analysis_output, roast_output, audio_output]