File size: 930 Bytes
818c35b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import subprocess

# Define the folder containing the .npy files
folder_path = "/home/haytham/ProtoMotions/parallel2"

# Iterate through all files in the folder
for file_name in os.listdir(folder_path):
    if file_name.endswith(".npy"):
        npz_file_name = file_name.replace(".npy", ".npz")
        # Construct the command
        if os.path.exists(os.path.join(folder_path, npz_file_name)):
            continue
        command = [
            "python",
            "phys_anim/scripts/play_motion.py",
            f"parallel2/{file_name}",
            "isaaclab",
            "g1"
        ]
        
        # Run the command
        subprocess.run(command, cwd="/home/haytham/ProtoMotions")
        
        # Rename 'test_motion_data.npz' to match the .npy file name
        os.rename(
            os.path.join(folder_path, "test_motion_data.npz"),
            os.path.join(folder_path, npz_file_name)
        )