Spaces:
Running
on
L40S
Running
on
L40S
File size: 829 Bytes
2252f3d |
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 |
import os
from tqdm import tqdm
from glob import glob
def rename_customhumans():
root = '/data/lipeng/human_scan/CustomHumans/smplx/'
file_paths = glob(os.path.join(root, '*/*_smpl.obj'))
for file_path in tqdm(file_paths):
new_path = file_path.replace('_smpl', '')
os.rename(file_path, new_path)
def rename_thuman21():
root = '/data/lipeng/human_scan/THuman2.1/smplx/'
file_paths = glob(os.path.join(root, '*/*.obj'))
for file_path in tqdm(file_paths):
obj_name = file_path.split('/')[-2]
folder_name = os.path.dirname(file_path)
new_path = os.path.join(folder_name, obj_name+'.obj')
# print(new_path)
# print(file_path)
os.rename(file_path, new_path)
if __name__ == '__main__':
rename_thuman21()
rename_customhumans() |