Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -395,11 +395,11 @@ def switch_working_frame(working_frame, scanned_frames, video_frames_dir):
|
|
395 |
new_working_frame = os.path.join(video_frames_dir, scanned_frames[ann_frame_idx])
|
396 |
return gr.State([]), gr.State([]), new_working_frame, new_working_frame
|
397 |
|
398 |
-
def reset_propagation(predictor, stored_inference_state):
|
399 |
|
400 |
predictor.reset_state(stored_inference_state)
|
401 |
print(f"RESET State: {stored_inference_state} ")
|
402 |
-
return gr.update(value=None, visible=False), stored_inference_state, None, ["frame_0.jpg"], first_frame_path, "frame_0.jpg", gr.update(visible=False)
|
403 |
|
404 |
with gr.Blocks() as demo:
|
405 |
first_frame_path = gr.State()
|
@@ -544,8 +544,8 @@ with gr.Blocks() as demo:
|
|
544 |
|
545 |
reset_prpgt_brn.click(
|
546 |
fn = reset_propagation,
|
547 |
-
inputs = [loaded_predictor, stored_inference_state],
|
548 |
-
outputs = [output_propagated, stored_inference_state, output_result, available_frames_to_check, input_first_frame_image, working_frame, reset_prpgt_brn],
|
549 |
queue=False
|
550 |
)
|
551 |
|
|
|
395 |
new_working_frame = os.path.join(video_frames_dir, scanned_frames[ann_frame_idx])
|
396 |
return gr.State([]), gr.State([]), new_working_frame, new_working_frame
|
397 |
|
398 |
+
def reset_propagation(first_frame_path, predictor, stored_inference_state):
|
399 |
|
400 |
predictor.reset_state(stored_inference_state)
|
401 |
print(f"RESET State: {stored_inference_state} ")
|
402 |
+
return first_frame_path, gr.update(value=None, visible=False), stored_inference_state, None, ["frame_0.jpg"], first_frame_path, "frame_0.jpg", gr.update(visible=False)
|
403 |
|
404 |
with gr.Blocks() as demo:
|
405 |
first_frame_path = gr.State()
|
|
|
544 |
|
545 |
reset_prpgt_brn.click(
|
546 |
fn = reset_propagation,
|
547 |
+
inputs = [first_frame_path, loaded_predictor, stored_inference_state],
|
548 |
+
outputs = [points_map, output_propagated, stored_inference_state, output_result, available_frames_to_check, input_first_frame_image, working_frame, reset_prpgt_brn],
|
549 |
queue=False
|
550 |
)
|
551 |
|