emirkisa commited on
Commit
71c2b95
·
verified ·
1 Parent(s): 8ce3369

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -907,11 +907,13 @@ def build_ui():
907
  value=str(_s_path) if _s_path.exists() else None,
908
  label=f"start · {_vc_label(_start_seq)}",
909
  autoplay=True, loop=True, height=280,
 
910
  )
911
  gr.Video(
912
  value=str(_e_path) if _e_path.exists() else None,
913
  label=f"end · {_vc_label(_end_seq)}",
914
  autoplay=True, loop=True, height=280,
 
915
  )
916
 
917
  # ──────────────────────────────────────────────────────────────
@@ -961,9 +963,12 @@ demo = build_ui()
961
  start_precache(fps=DEFAULT_FPS, workers=4)
962
 
963
  if __name__ == "__main__":
 
 
964
  if IS_HF_SPACE:
965
  # HF Spaces runs `python app.py` directly — must bind to 0.0.0.0.
966
- demo.launch(server_name="0.0.0.0", server_port=7860, theme=gr.themes.Soft())
 
967
  else:
968
  parser = argparse.ArgumentParser(description="DAVIS Dataset Explorer")
969
  parser.add_argument("--share", action="store_true")
@@ -971,4 +976,5 @@ if __name__ == "__main__":
971
  parser.add_argument("--host", default="0.0.0.0")
972
  args = parser.parse_args()
973
  demo.launch(server_name=args.host, server_port=args.port,
974
- share=args.share, theme=gr.themes.Soft())
 
 
907
  value=str(_s_path) if _s_path.exists() else None,
908
  label=f"start · {_vc_label(_start_seq)}",
909
  autoplay=True, loop=True, height=280,
910
+ interactive=False,
911
  )
912
  gr.Video(
913
  value=str(_e_path) if _e_path.exists() else None,
914
  label=f"end · {_vc_label(_end_seq)}",
915
  autoplay=True, loop=True, height=280,
916
+ interactive=False,
917
  )
918
 
919
  # ──────────────────────────────────────────────────────────────
 
963
  start_precache(fps=DEFAULT_FPS, workers=4)
964
 
965
  if __name__ == "__main__":
966
+ _allowed = [str(PROCESSED_DAVIS_DIR)] if PROCESSED_DAVIS_DIR.exists() else []
967
+
968
  if IS_HF_SPACE:
969
  # HF Spaces runs `python app.py` directly — must bind to 0.0.0.0.
970
+ demo.launch(server_name="0.0.0.0", server_port=7860,
971
+ theme=gr.themes.Soft(), allowed_paths=_allowed)
972
  else:
973
  parser = argparse.ArgumentParser(description="DAVIS Dataset Explorer")
974
  parser.add_argument("--share", action="store_true")
 
976
  parser.add_argument("--host", default="0.0.0.0")
977
  args = parser.parse_args()
978
  demo.launch(server_name=args.host, server_port=args.port,
979
+ share=args.share, theme=gr.themes.Soft(),
980
+ allowed_paths=_allowed)