Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -335,7 +335,7 @@ def propagate_to_all(video_in, checkpoint, stored_inference_state, stored_frame_
|
|
| 335 |
|
| 336 |
|
| 337 |
if vis_frame_type == "check":
|
| 338 |
-
return gr.update(value=jpeg_images), gr.update(value=None)
|
| 339 |
elif vis_frame_type == "render":
|
| 340 |
# Create a video clip from the image sequence
|
| 341 |
original_fps = get_video_fps(video_in)
|
|
@@ -351,7 +351,7 @@ def propagate_to_all(video_in, checkpoint, stored_inference_state, stored_frame_
|
|
| 351 |
codec='libx264'
|
| 352 |
)
|
| 353 |
|
| 354 |
-
return gr.update(value=None), gr.update(value=final_vid_output_path)
|
| 355 |
|
| 356 |
def update_ui(vis_frame_type):
|
| 357 |
if vis_frame_type == "check":
|
|
@@ -403,6 +403,7 @@ with gr.Blocks() as demo:
|
|
| 403 |
video_in = gr.Video(label="Video IN")
|
| 404 |
|
| 405 |
with gr.Column():
|
|
|
|
| 406 |
output_result = gr.Image()
|
| 407 |
with gr.Row():
|
| 408 |
vis_frame_type = gr.Radio(label="Propagation level", choices=["check", "render"], value="check", scale=2)
|
|
@@ -446,7 +447,7 @@ with gr.Blocks() as demo:
|
|
| 446 |
).then(
|
| 447 |
fn = propagate_to_all,
|
| 448 |
inputs = [video_in, checkpoint, stored_inference_state, stored_frame_names, video_frames_dir, vis_frame_type],
|
| 449 |
-
outputs = [output_propagated, output_video]
|
| 450 |
)
|
| 451 |
|
| 452 |
demo.launch(show_api=False, show_error=True)
|
|
|
|
| 335 |
|
| 336 |
|
| 337 |
if vis_frame_type == "check":
|
| 338 |
+
return gr.update(value=jpeg_images), gr.update(value=None), gr.update(choices=jpeg_images)
|
| 339 |
elif vis_frame_type == "render":
|
| 340 |
# Create a video clip from the image sequence
|
| 341 |
original_fps = get_video_fps(video_in)
|
|
|
|
| 351 |
codec='libx264'
|
| 352 |
)
|
| 353 |
|
| 354 |
+
return gr.update(value=None), gr.update(value=final_vid_output_path), None
|
| 355 |
|
| 356 |
def update_ui(vis_frame_type):
|
| 357 |
if vis_frame_type == "check":
|
|
|
|
| 403 |
video_in = gr.Video(label="Video IN")
|
| 404 |
|
| 405 |
with gr.Column():
|
| 406 |
+
working_frame = gr.Dropdown(label="working frame ID", choices=None, value=None)
|
| 407 |
output_result = gr.Image()
|
| 408 |
with gr.Row():
|
| 409 |
vis_frame_type = gr.Radio(label="Propagation level", choices=["check", "render"], value="check", scale=2)
|
|
|
|
| 447 |
).then(
|
| 448 |
fn = propagate_to_all,
|
| 449 |
inputs = [video_in, checkpoint, stored_inference_state, stored_frame_names, video_frames_dir, vis_frame_type],
|
| 450 |
+
outputs = [output_propagated, output_video, working_frame]
|
| 451 |
)
|
| 452 |
|
| 453 |
demo.launch(show_api=False, show_error=True)
|