Spaces:
Running
on
Zero
Running
on
Zero
Update gradio_tabs/animation.py
Browse files- gradio_tabs/animation.py +6 -5
gradio_tabs/animation.py
CHANGED
@@ -137,11 +137,12 @@ def animation(gen, chunk_size, device):
|
|
137 |
video_target_tensor = vid_target_tensor.to(device)
|
138 |
|
139 |
animated_video = gen.animate_batch(image_tensor, video_target_tensor, labels_v, selected_s, chunk_size)
|
|
|
140 |
|
141 |
# postprocessing
|
142 |
animated_video = vid_postprocessing(animated_video, fps)
|
143 |
-
|
144 |
-
return animated_video
|
145 |
|
146 |
|
147 |
def clear_media():
|
@@ -249,8 +250,8 @@ def animation(gen, chunk_size, device):
|
|
249 |
|
250 |
animate_btn.click(
|
251 |
fn=animate_media,
|
252 |
-
inputs=[image_input, video_input] + inputs_s,
|
253 |
-
outputs=[video_output],
|
254 |
show_progress=True
|
255 |
)
|
256 |
|
@@ -274,7 +275,7 @@ def animation(gen, chunk_size, device):
|
|
274 |
],
|
275 |
fn=animate_media,
|
276 |
inputs=[image_input, video_input] + inputs_s,
|
277 |
-
outputs=[video_output],
|
278 |
cache_examples=True,
|
279 |
)
|
280 |
|
|
|
137 |
video_target_tensor = vid_target_tensor.to(device)
|
138 |
|
139 |
animated_video = gen.animate_batch(image_tensor, video_target_tensor, labels_v, selected_s, chunk_size)
|
140 |
+
edited_image = animated_video[:,:,0,:,:]
|
141 |
|
142 |
# postprocessing
|
143 |
animated_video = vid_postprocessing(animated_video, fps)
|
144 |
+
edited_image = img_postprocessing(edited_image)
|
145 |
+
return edited_image, animated_video
|
146 |
|
147 |
|
148 |
def clear_media():
|
|
|
250 |
|
251 |
animate_btn.click(
|
252 |
fn=animate_media,
|
253 |
+
inputs=[image_input, video_input] + inputs_s,
|
254 |
+
outputs=[image_output, video_output],
|
255 |
show_progress=True
|
256 |
)
|
257 |
|
|
|
275 |
],
|
276 |
fn=animate_media,
|
277 |
inputs=[image_input, video_input] + inputs_s,
|
278 |
+
outputs=[image_output, video_output],
|
279 |
cache_examples=True,
|
280 |
)
|
281 |
|