Update visualization/plot_3d_global.py
Browse files
visualization/plot_3d_global.py
CHANGED
|
@@ -115,18 +115,14 @@ def plot_3d_motion(args, figsize=(10, 10), fps=120, radius=4):
|
|
| 115 |
return torch.from_numpy(out)
|
| 116 |
|
| 117 |
|
| 118 |
-
def draw_to_batch(smpl_joints_batch, title_batch=None, outname=None)
|
| 119 |
-
|
| 120 |
batch_size = len(smpl_joints_batch)
|
| 121 |
out = []
|
| 122 |
-
for i in range(batch_size)
|
| 123 |
out.append(plot_3d_motion([smpl_joints_batch[i], None, title_batch[i] if title_batch is not None else None]))
|
| 124 |
if outname is not None:
|
|
|
|
|
|
|
| 125 |
imageio.mimsave(outname[i], np.array(out[-1]), fps=20)
|
| 126 |
out = torch.stack(out, axis=0)
|
| 127 |
-
return out
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
|
|
|
| 115 |
return torch.from_numpy(out)
|
| 116 |
|
| 117 |
|
| 118 |
+
def draw_to_batch(smpl_joints_batch, title_batch=None, outname=None):
|
|
|
|
| 119 |
batch_size = len(smpl_joints_batch)
|
| 120 |
out = []
|
| 121 |
+
for i in range(batch_size):
|
| 122 |
out.append(plot_3d_motion([smpl_joints_batch[i], None, title_batch[i] if title_batch is not None else None]))
|
| 123 |
if outname is not None:
|
| 124 |
+
if not os.path.exists(os.path.dirname(outname[i])):
|
| 125 |
+
os.makedirs(os.path.dirname(outname[i]))
|
| 126 |
imageio.mimsave(outname[i], np.array(out[-1]), fps=20)
|
| 127 |
out = torch.stack(out, axis=0)
|
| 128 |
+
return out
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|