demo.flagging_mode
#7
by
nishanth-saka
- opened
app.py
CHANGED
|
@@ -143,19 +143,21 @@ example_flow = "flow_stats.json" if os.path.exists("flow_stats.json") else None
|
|
| 143 |
|
| 144 |
demo = gr.Interface(
|
| 145 |
fn=run_app,
|
| 146 |
-
inputs=[
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
gr.Video(label="Violation Output Video"),
|
| 152 |
-
gr.JSON(label="Per-Vehicle Log"),
|
| 153 |
-
gr.JSON(label="Summary")
|
| 154 |
-
],
|
| 155 |
title="π Wrong-Direction Detection β Stage 3",
|
| 156 |
description=description_text,
|
| 157 |
-
examples=
|
| 158 |
)
|
| 159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
if __name__ == "__main__":
|
| 161 |
-
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
demo = gr.Interface(
|
| 145 |
fn=run_app,
|
| 146 |
+
inputs=[gr.Video(label="Upload Traffic Video (.mp4)"),
|
| 147 |
+
gr.File(label="Upload flow_stats.json (Stage 2 Output)")],
|
| 148 |
+
outputs=[gr.Video(label="Violation Output Video"),
|
| 149 |
+
gr.JSON(label="Per-Vehicle Log"),
|
| 150 |
+
gr.JSON(label="Summary")],
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
title="π Wrong-Direction Detection β Stage 3",
|
| 152 |
description=description_text,
|
| 153 |
+
examples=None, # disable example caching
|
| 154 |
)
|
| 155 |
|
| 156 |
+
# π§ disable all caching/flagging that causes _csv.Error
|
| 157 |
+
demo.flagging_mode = "never"
|
| 158 |
+
demo.cache_examples = False
|
| 159 |
+
|
| 160 |
if __name__ == "__main__":
|
| 161 |
+
os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"
|
| 162 |
+
demo.launch(server_name="0.0.0.0", server_port=7860, ssr_mode=False, show_api=False)
|
| 163 |
+
|