Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import subprocess
|
| 2 |
import re
|
| 3 |
from typing import List, Tuple, Optional
|
| 4 |
-
import spaces
|
| 5 |
|
| 6 |
# Define the command to be executed
|
| 7 |
command = ["python", "setup.py", "build_ext", "--inplace"]
|
|
@@ -327,7 +327,7 @@ def get_mask_sam_process(
|
|
| 327 |
# return gr.update(visible=True), "output_first_frame.jpg", frame_names, predictor, inference_state, gr.update(choices=available_frames_to_check, value=working_frame, visible=True)
|
| 328 |
return "output_first_frame.jpg", frame_names, predictor, inference_state, gr.update(choices=available_frames_to_check, value=working_frame, visible=False)
|
| 329 |
|
| 330 |
-
|
| 331 |
def propagate_to_all(video_in, checkpoint, stored_inference_state, stored_frame_names, video_frames_dir, vis_frame_type, available_frames_to_check, working_frame, progress=gr.Progress(track_tqdm=True)):
|
| 332 |
# use bfloat16 for the entire notebook
|
| 333 |
torch.autocast(device_type="cuda", dtype=torch.bfloat16).__enter__()
|
|
@@ -644,4 +644,4 @@ with gr.Blocks(css=css) as demo:
|
|
| 644 |
outputs = [output_propagated, output_video, working_frame, available_frames_to_check, reset_prpgt_brn]
|
| 645 |
)
|
| 646 |
|
| 647 |
-
demo.launch()
|
|
|
|
| 1 |
import subprocess
|
| 2 |
import re
|
| 3 |
from typing import List, Tuple, Optional
|
| 4 |
+
#import spaces
|
| 5 |
|
| 6 |
# Define the command to be executed
|
| 7 |
command = ["python", "setup.py", "build_ext", "--inplace"]
|
|
|
|
| 327 |
# return gr.update(visible=True), "output_first_frame.jpg", frame_names, predictor, inference_state, gr.update(choices=available_frames_to_check, value=working_frame, visible=True)
|
| 328 |
return "output_first_frame.jpg", frame_names, predictor, inference_state, gr.update(choices=available_frames_to_check, value=working_frame, visible=False)
|
| 329 |
|
| 330 |
+
#@spaces.GPU
|
| 331 |
def propagate_to_all(video_in, checkpoint, stored_inference_state, stored_frame_names, video_frames_dir, vis_frame_type, available_frames_to_check, working_frame, progress=gr.Progress(track_tqdm=True)):
|
| 332 |
# use bfloat16 for the entire notebook
|
| 333 |
torch.autocast(device_type="cuda", dtype=torch.bfloat16).__enter__()
|
|
|
|
| 644 |
outputs = [output_propagated, output_video, working_frame, available_frames_to_check, reset_prpgt_brn]
|
| 645 |
)
|
| 646 |
|
| 647 |
+
demo.launch(share = True)
|