Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
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 |
|