Update app.py
Browse files
app.py
CHANGED
|
@@ -223,8 +223,8 @@ def render(motions, device_id=0, name='test_vis'):
|
|
| 223 |
|
| 224 |
out = np.stack(vid, axis=0)
|
| 225 |
imageio.mimwrite(f'output/results.gif', out, fps=20)
|
| 226 |
-
|
| 227 |
-
|
| 228 |
del out, vertices
|
| 229 |
return f'output/results.mp4'
|
| 230 |
|
|
@@ -242,8 +242,8 @@ def predict(clip_text, method='fast'):
|
|
| 242 |
if method == 'fast':
|
| 243 |
xyz = pred_xyz.reshape(1, -1, 22, 3)
|
| 244 |
pose_vis = plot_3d.draw_to_batch(xyz.detach().cpu().numpy(), title_batch=None, outname=[f'output/results.gif'])
|
| 245 |
-
|
| 246 |
-
|
| 247 |
return f'output/results.mp4'
|
| 248 |
elif method == 'slow':
|
| 249 |
output_path = render(pred_xyz.detach().cpu().numpy().squeeze(axis=0), device_id=0, name=output_name)
|
|
|
|
| 223 |
|
| 224 |
out = np.stack(vid, axis=0)
|
| 225 |
imageio.mimwrite(f'output/results.gif', out, fps=20)
|
| 226 |
+
out_video = mp.VideoFileClip(f'output/results.gif')
|
| 227 |
+
out_video.write_videofile("output/results.mp4")
|
| 228 |
del out, vertices
|
| 229 |
return f'output/results.mp4'
|
| 230 |
|
|
|
|
| 242 |
if method == 'fast':
|
| 243 |
xyz = pred_xyz.reshape(1, -1, 22, 3)
|
| 244 |
pose_vis = plot_3d.draw_to_batch(xyz.detach().cpu().numpy(), title_batch=None, outname=[f'output/results.gif'])
|
| 245 |
+
out_video = mp.VideoFileClip("output/results.gif")
|
| 246 |
+
out_video.write_videofile("output/results.mp4")
|
| 247 |
return f'output/results.mp4'
|
| 248 |
elif method == 'slow':
|
| 249 |
output_path = render(pred_xyz.detach().cpu().numpy().squeeze(axis=0), device_id=0, name=output_name)
|