Skip to content

Commit

Permalink
add exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mks0601 authored Sep 29, 2024
1 parent 8cc73c5 commit 0141bd6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions fitting/tools/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ def parse_args():
result = os.system(cmd)
if (result != 0):
print('something bad happened when removing unnecessary frames. terminate the script.')
sys.exist()
sys.exit()

# make camera parameters
cmd = 'python make_virtual_cam_params.py --root_path ' + root_path
print(cmd)
result = os.system(cmd)
if (result != 0):
print('something bad happened when making the virtual camera parameters. terminate the script.')
sys.exist()
sys.exit()

# DECA (get initial FLAME parameters)
os.chdir('./DECA')
Expand All @@ -47,7 +47,7 @@ def parse_args():
result = os.system(cmd)
if (result != 0):
print('something bad happened when running DECA. terminate the script.')
sys.exist()
sys.exit()
os.chdir('..')

# Hand4Whole (get initial SMPLX parameters)
Expand All @@ -57,7 +57,7 @@ def parse_args():
result = os.system(cmd)
if (result != 0):
print('something bad happened when running Hand4Whole. terminate the script.')
sys.exist()
sys.exit()
os.chdir('../../')

# mmpose (get 2D whole-body keypoints)
Expand All @@ -67,7 +67,7 @@ def parse_args():
result = os.system(cmd)
if (result != 0):
print('something bad happened when running mmpose. terminate the script.')
sys.exist()
sys.exit()
os.chdir('..')

# fit SMPLX
Expand All @@ -77,14 +77,14 @@ def parse_args():
result = os.system(cmd)
if (result != 0):
print('something bad happened when fitting. terminate the script.')
sys.exist()
sys.exit()
os.chdir('../tools')
cmd = 'mv ' + osp.join('..', 'output', 'result', subject_id, '*') + ' ' + osp.join(root_path, '.')
print(cmd)
result = os.system(cmd)
if (result != 0):
print('something bad happened when moving the fitted files to root_path. terminate the script.')
sys.exist()
sys.exit()

# unwrap textures of FLAME
os.chdir('../main')
Expand All @@ -93,19 +93,19 @@ def parse_args():
result = os.system(cmd)
if (result != 0):
print('something bad happened when unwrapping the face images to FLAME UV texture. terminate the script.')
sys.exist()
sys.exit()
os.chdir('../tools')
cmd = 'mv ' + osp.join('..', 'output', 'result', subject_id, 'unwrapped_textures', '*') + ' ' + osp.join(root_path, 'smplx_optimized', '.')
result = os.system(cmd)
if (result != 0):
print('something bad happened when moving the unwrapped FLAME UV texture to root_path. terminate the script.')
sys.exist()
sys.exit()

# smooth SMPLX
cmd = 'python smooth_smplx_params.py --root_path ' + root_path
print(cmd)
result = os.system(cmd)
if (result != 0):
print('something bad happened when smoothing smplx parameters. terminate the script.')
sys.exist()
sys.exit()

0 comments on commit 0141bd6

Please sign in to comment.