SuriRaja commited on
Commit
0ad8337
·
1 Parent(s): 659239d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -10
app.py CHANGED
@@ -117,16 +117,11 @@ with gr.Blocks(theme=gr.themes.Soft()) as app:
117
  resume_btn.click(toggle_resume, outputs=status_text)
118
  frame_slider.change(set_frame_rate, inputs=[frame_slider])
119
 
120
- def streaming_loop():
121
- while True:
122
- frame, metrics, logs, chart = monitor_feed()
123
- # Check for alerts
124
- if anomaly_counts and anomaly_counts[-1] >= 5:
125
- status = "**Status:** \ud83d\udd34 Alert: High Anomaly Rate"
126
- else:
127
- status = "**Status:** \ud83d\udfe2 Running" if not paused else "**Status:** \u23f8\ufe0f Paused"
128
- yield [frame, metrics, logs, chart, status]
129
- time.sleep(frame_rate)
130
 
131
  app.load(streaming_loop, outputs=[video_output, metrics_output, logs_output, chart_output, status_text])
132
 
 
117
  resume_btn.click(toggle_resume, outputs=status_text)
118
  frame_slider.change(set_frame_rate, inputs=[frame_slider])
119
 
120
+ def streaming_loop():
121
+ while True:
122
+ frame, metrics = monitor_feed()
123
+ yield frame, metrics
124
+ time.sleep(frame_rate)
 
 
 
 
 
125
 
126
  app.load(streaming_loop, outputs=[video_output, metrics_output, logs_output, chart_output, status_text])
127