Spaces:
Running
on
L40S
Running
on
L40S
Update gradio_tabs/vid_edit.py
Browse files- gradio_tabs/vid_edit.py +5 -3
gradio_tabs/vid_edit.py
CHANGED
@@ -143,11 +143,13 @@ def vid_edit(gen, chunk_size, device):
|
|
143 |
video_target_tensor = video_target_tensor.to(device)
|
144 |
|
145 |
edited_video_tensor = gen.edit_vid_batch(video_target_tensor, labels_v, selected_s, chunk_size)
|
|
|
146 |
|
147 |
# de-norm
|
148 |
animated_video, animated_all_video = vid_all_save(video_target_tensor, edited_video_tensor, fps)
|
|
|
149 |
|
150 |
-
return animated_video, animated_all_video
|
151 |
|
152 |
|
153 |
def clear_media():
|
@@ -246,7 +248,7 @@ def vid_edit(gen, chunk_size, device):
|
|
246 |
animate_btn.click(
|
247 |
fn=edit_vid,
|
248 |
inputs=[video_input] + inputs_s, # [image_input, video_input] + inputs_s,
|
249 |
-
outputs=[video_output, video_all_output],
|
250 |
)
|
251 |
|
252 |
clear_btn.click(
|
@@ -269,7 +271,7 @@ def vid_edit(gen, chunk_size, device):
|
|
269 |
],
|
270 |
fn=edit_vid,
|
271 |
inputs=[video_input] + inputs_s,
|
272 |
-
outputs=[video_output, video_all_output],
|
273 |
cache_examples=True,
|
274 |
)
|
275 |
|
|
|
143 |
video_target_tensor = video_target_tensor.to(device)
|
144 |
|
145 |
edited_video_tensor = gen.edit_vid_batch(video_target_tensor, labels_v, selected_s, chunk_size)
|
146 |
+
edited_image_tensor = edited_video_tensor[:,:,0,:,:]
|
147 |
|
148 |
# de-norm
|
149 |
animated_video, animated_all_video = vid_all_save(video_target_tensor, edited_video_tensor, fps)
|
150 |
+
edited_image = img_postprocessing(edited_image_tensor)
|
151 |
|
152 |
+
return edited_image, animated_video, animated_all_video
|
153 |
|
154 |
|
155 |
def clear_media():
|
|
|
248 |
animate_btn.click(
|
249 |
fn=edit_vid,
|
250 |
inputs=[video_input] + inputs_s, # [image_input, video_input] + inputs_s,
|
251 |
+
outputs=[image_output, video_output, video_all_output],
|
252 |
)
|
253 |
|
254 |
clear_btn.click(
|
|
|
271 |
],
|
272 |
fn=edit_vid,
|
273 |
inputs=[video_input] + inputs_s,
|
274 |
+
outputs=[image_output, video_output, video_all_output],
|
275 |
cache_examples=True,
|
276 |
)
|
277 |
|