Spaces:
Running
on
Zero
Running
on
Zero
Update gradio_app.py
Browse files- gradio_app.py +6 -6
gradio_app.py
CHANGED
@@ -104,7 +104,7 @@ def infer(frame1_path, frame2_path):
|
|
104 |
weighted_average=weighted_average, # True
|
105 |
noise_injection_steps=noise_injection_steps, # 0
|
106 |
noise_injection_ratio= noise_injection_ratio, # 0.5
|
107 |
-
decode_chunk_size=
|
108 |
).frames[0]
|
109 |
|
110 |
print(f"FRAMES: {frames}")
|
@@ -113,15 +113,15 @@ def infer(frame1_path, frame2_path):
|
|
113 |
|
114 |
check_outputs_folder(out_dir)
|
115 |
os.makedirs(out_dir, exist_ok=True)
|
116 |
-
out_path = "result/video_result.
|
117 |
|
118 |
-
|
119 |
if out_path.endswith('.gif'):
|
120 |
frames[0].save(out_path, save_all=True, append_images=frames[1:], duration=142, loop=0)
|
121 |
else:
|
122 |
export_to_video(frames, out_path, fps=7)
|
123 |
-
|
124 |
-
return
|
125 |
|
126 |
with gr.Blocks() as demo:
|
127 |
|
@@ -133,7 +133,7 @@ with gr.Blocks() as demo:
|
|
133 |
image_input2 = gr.Image(type="filepath")
|
134 |
submit_btn = gr.Button("Submit")
|
135 |
with gr.Column():
|
136 |
-
output = gr.
|
137 |
|
138 |
submit_btn.click(
|
139 |
fn = infer,
|
|
|
104 |
weighted_average=weighted_average, # True
|
105 |
noise_injection_steps=noise_injection_steps, # 0
|
106 |
noise_injection_ratio= noise_injection_ratio, # 0.5
|
107 |
+
decode_chunk_size=8
|
108 |
).frames[0]
|
109 |
|
110 |
print(f"FRAMES: {frames}")
|
|
|
113 |
|
114 |
check_outputs_folder(out_dir)
|
115 |
os.makedirs(out_dir, exist_ok=True)
|
116 |
+
out_path = "result/video_result.mp4"
|
117 |
|
118 |
+
|
119 |
if out_path.endswith('.gif'):
|
120 |
frames[0].save(out_path, save_all=True, append_images=frames[1:], duration=142, loop=0)
|
121 |
else:
|
122 |
export_to_video(frames, out_path, fps=7)
|
123 |
+
|
124 |
+
return out_path
|
125 |
|
126 |
with gr.Blocks() as demo:
|
127 |
|
|
|
133 |
image_input2 = gr.Image(type="filepath")
|
134 |
submit_btn = gr.Button("Submit")
|
135 |
with gr.Column():
|
136 |
+
output = gr.Video()
|
137 |
|
138 |
submit_btn.click(
|
139 |
fn = infer,
|