Update app.py
Browse files
app.py
CHANGED
|
@@ -299,7 +299,7 @@ def get_mask_sam_process(
|
|
| 299 |
available_frames_to_check.append(working_frame)
|
| 300 |
print(available_frames_to_check)
|
| 301 |
|
| 302 |
-
return "output_first_frame.jpg", frame_names, predictor, inference_state, gr.update(choices=available_frames_to_check, value=working_frame, visible=True)
|
| 303 |
|
| 304 |
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)):
|
| 305 |
#### PROPAGATION ####
|
|
@@ -453,7 +453,7 @@ with gr.Blocks() as demo:
|
|
| 453 |
with gr.Column():
|
| 454 |
with gr.Row():
|
| 455 |
working_frame = gr.Dropdown(label="working frame ID", choices=[""], value=None, visible=False, allow_custom_value=False, interactive=True)
|
| 456 |
-
change_current = gr.Button("change current
|
| 457 |
output_result = gr.Image(label="current working mask ref")
|
| 458 |
with gr.Row():
|
| 459 |
vis_frame_type = gr.Radio(label="Propagation level", choices=["check", "render"], value="check", scale=2)
|
|
@@ -539,6 +539,7 @@ with gr.Blocks() as demo:
|
|
| 539 |
available_frames_to_check,
|
| 540 |
],
|
| 541 |
outputs = [
|
|
|
|
| 542 |
output_result,
|
| 543 |
stored_frame_names,
|
| 544 |
loaded_predictor,
|
|
|
|
| 299 |
available_frames_to_check.append(working_frame)
|
| 300 |
print(available_frames_to_check)
|
| 301 |
|
| 302 |
+
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)
|
| 303 |
|
| 304 |
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)):
|
| 305 |
#### PROPAGATION ####
|
|
|
|
| 453 |
with gr.Column():
|
| 454 |
with gr.Row():
|
| 455 |
working_frame = gr.Dropdown(label="working frame ID", choices=[""], value=None, visible=False, allow_custom_value=False, interactive=True)
|
| 456 |
+
change_current = gr.Button("change current", visible=False)
|
| 457 |
output_result = gr.Image(label="current working mask ref")
|
| 458 |
with gr.Row():
|
| 459 |
vis_frame_type = gr.Radio(label="Propagation level", choices=["check", "render"], value="check", scale=2)
|
|
|
|
| 539 |
available_frames_to_check,
|
| 540 |
],
|
| 541 |
outputs = [
|
| 542 |
+
change_current,
|
| 543 |
output_result,
|
| 544 |
stored_frame_names,
|
| 545 |
loaded_predictor,
|