Spaces:
Running
on
Zero
Running
on
Zero
join thread
Browse files
app.py
CHANGED
|
@@ -907,7 +907,7 @@ def make_input_images_section():
|
|
| 907 |
|
| 908 |
def make_input_video_section():
|
| 909 |
# gr.Markdown('### Input Video')
|
| 910 |
-
input_gallery = gr.Video(value=None, label="Select video", elem_id="video-input", height="auto", show_share_button=False)
|
| 911 |
gr.Markdown('_image backbone model is used to extract features from each frame, NCUT is computed on all frames_')
|
| 912 |
# max_frames_number = gr.Number(100, label="Max frames", elem_id="max_frames")
|
| 913 |
max_frames_number = gr.Slider(1, 200, step=1, label="Max frames", value=100, elem_id="max_frames")
|
|
@@ -1717,15 +1717,19 @@ with demo:
|
|
| 1717 |
if os.path.exists("/hf_token.txt"):
|
| 1718 |
os.environ["HF_ACCESS_TOKEN"] = open("/hf_token.txt").read().strip()
|
| 1719 |
|
|
|
|
|
|
|
|
|
|
| 1720 |
if DOWNLOAD_ALL_MODELS_DATASETS:
|
| 1721 |
from ncut_pytorch.backbone import download_all_models
|
| 1722 |
-
threading.Thread(target=download_all_models).start()
|
| 1723 |
-
|
| 1724 |
-
threading.Thread(target=
|
|
|
|
| 1725 |
|
| 1726 |
-
|
| 1727 |
-
|
| 1728 |
-
|
| 1729 |
|
| 1730 |
|
| 1731 |
# # %%
|
|
|
|
| 907 |
|
| 908 |
def make_input_video_section():
|
| 909 |
# gr.Markdown('### Input Video')
|
| 910 |
+
input_gallery = gr.Video(value=None, label="Select video", elem_id="video-input", height="auto", show_share_button=False, interactive=True)
|
| 911 |
gr.Markdown('_image backbone model is used to extract features from each frame, NCUT is computed on all frames_')
|
| 912 |
# max_frames_number = gr.Number(100, label="Max frames", elem_id="max_frames")
|
| 913 |
max_frames_number = gr.Slider(1, 200, step=1, label="Max frames", value=100, elem_id="max_frames")
|
|
|
|
| 1717 |
if os.path.exists("/hf_token.txt"):
|
| 1718 |
os.environ["HF_ACCESS_TOKEN"] = open("/hf_token.txt").read().strip()
|
| 1719 |
|
| 1720 |
+
|
| 1721 |
+
demo.launch(share=True)
|
| 1722 |
+
|
| 1723 |
if DOWNLOAD_ALL_MODELS_DATASETS:
|
| 1724 |
from ncut_pytorch.backbone import download_all_models
|
| 1725 |
+
t1 = threading.Thread(target=download_all_models).start()
|
| 1726 |
+
t1.join()
|
| 1727 |
+
t3 = threading.Thread(target=download_all_datasets).start()
|
| 1728 |
+
t3.join()
|
| 1729 |
|
| 1730 |
+
from ncut_pytorch.backbone_text import download_all_models
|
| 1731 |
+
t2 = threading.Thread(target=download_all_models).start()
|
| 1732 |
+
t2.join()
|
| 1733 |
|
| 1734 |
|
| 1735 |
# # %%
|