rsax commited on
Commit
5e64660
·
verified ·
1 Parent(s): 3301936

Update visualization/plot_3d_global.py

Browse files
Files changed (1) hide show
  1. visualization/plot_3d_global.py +5 -2
visualization/plot_3d_global.py CHANGED
@@ -11,7 +11,10 @@ import imageio
11
 
12
  def plot_3d_motion(args, figsize=(10, 10), fps=120, radius=4):
13
  matplotlib.use('Agg')
14
-
 
 
 
15
 
16
  joints, out_name, title = args
17
 
@@ -117,7 +120,7 @@ def plot_3d_motion(args, figsize=(10, 10), fps=120, radius=4):
117
  plt.close()
118
 
119
  # Save individual frames for verification
120
- frame_path = f"/workspace/animation/frame_{index}.png"
121
  plt.imsave(frame_path, arr)
122
  if not os.path.exists(frame_path):
123
  print(f"Error: Frame {index} not saved to {frame_path}")
 
11
 
12
  def plot_3d_motion(args, figsize=(10, 10), fps=120, radius=4):
13
  matplotlib.use('Agg')
14
+
15
+ dir_path = "/workspace/animation"
16
+ if not os.path.exists(dir_path):
17
+ os.makedirs(dir_path)
18
 
19
  joints, out_name, title = args
20
 
 
120
  plt.close()
121
 
122
  # Save individual frames for verification
123
+ frame_path = os.path.join(dir_path, f"frame_{index}.png")
124
  plt.imsave(frame_path, arr)
125
  if not os.path.exists(frame_path):
126
  print(f"Error: Frame {index} not saved to {frame_path}")