Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retargeting on win #225

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test on win
  • Loading branch information
Emmanuel BONET committed Jun 28, 2023
commit 4c1e40203062be944b3169cdee3a3ee276a21b9b
5 changes: 4 additions & 1 deletion retargeting/option_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,7 @@ def get_std_bvh(args=None, dataset=None):
def try_mkdir(path):
import os
if not os.path.exists(path):
os.system('mkdir -p {}'.format(path))
if platform.system() == 'Windows':
os.system('mkdir {}'.format(path))
else:
os.system('mkdir -p {}'.format(path))
14 changes: 9 additions & 5 deletions retargeting/test.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import os
import platform
from os.path import join as pjoin
from get_error import full_batch
import numpy as np
from option_parser import try_mkdir
from eval import eval
import argparse

separator = '/'
if platform.system() == 'Windows':
separator = '\\'

def batch_copy(source_path, suffix, dest_path, dest_suffix=None):
try_mkdir(dest_path)
Expand All @@ -24,13 +28,13 @@ def batch_copy(source_path, suffix, dest_path, dest_suffix=None):
test_characters = ['Mousey_m', 'Goblin_m', 'Mremireh_m', 'Vampire_m']

parser = argparse.ArgumentParser()
parser.add_argument('--save_dir', type=str, default='./pretrained/')
parser.add_argument('--save_dir', type=str, default='.'+separator+'pretrained'+separator)
args = parser.parse_args()
prefix = args.save_dir

cross_dest_path = pjoin(prefix, 'results/cross_structure/')
intra_dest_path = pjoin(prefix, 'results/intra_structure/')
source_path = pjoin(prefix, 'results/bvh/')
cross_dest_path = pjoin(prefix, 'results'+separator+'cross_structure'+separator+'')
intra_dest_path = pjoin(prefix, 'results'+separator+'intra_structure'+separator+'')
source_path = pjoin(prefix, 'results'+separator+'bvh'+separator+'')

cross_error = []
intra_error = []
Expand Down Expand Up @@ -59,7 +63,7 @@ def batch_copy(source_path, suffix, dest_path, dest_suffix=None):
cross_error_mean = cross_error.mean()
intra_error_mean = intra_error.mean()

os.system('rm -r %s' % pjoin(prefix, 'results/bvh'))
os.system('rm -r %s' % pjoin(prefix, 'results'+separator+'bvh'))

print('Intra-retargeting error:', intra_error_mean)
print('Cross-retargeting error:', cross_error_mean)
Expand Down