Files changed (1) hide show
  1. app.py +13 -11
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
- gr.Video(label="Upload Traffic Video (.mp4)"),
148
- gr.File(label="Upload flow_stats.json (Stage 2 Output)")
149
- ],
150
- outputs=[
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=[[example_vid, example_flow]] if example_vid and example_flow else None,
158
  )
159
 
 
 
 
 
160
  if __name__ == "__main__":
161
- demo.launch()
 
 
 
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
+