| 27 | np.random.seed(0) |
| 28 | |
| 29 | def parse_args(): |
| 30 | parser = argparse.ArgumentParser(description='mmhuman3d test model') |
| 31 | parser.add_argument('config', help='test config file path') |
| 32 | parser.add_argument( |
| 33 | '--work-dir', help='the dir to save evaluation results') |
| 34 | parser.add_argument('checkpoint', help='checkpoint file') |
| 35 | parser.add_argument('--out', help='output result file') |
| 36 | parser.add_argument( |
| 37 | '--gpu_collect', |
| 38 | action='store_true', |
| 39 | help='whether to use gpu to collect results') |
| 40 | parser.add_argument('--tmpdir', help='tmp dir for writing some results') |
| 41 | parser.add_argument( |
| 42 | '--cfg-options', |
| 43 | nargs='+', |
| 44 | action=DictAction, |
| 45 | help='override some settings in the used config, the key-value pair ' |
| 46 | 'in xxx=yyy format will be merged into config file.') |
| 47 | parser.add_argument( |
| 48 | '--launcher', |
| 49 | choices=['none', 'pytorch', 'slurm', 'mpi'], |
| 50 | default='none', |
| 51 | help='job launcher') |
| 52 | parser.add_argument('--local_rank', type=int, default=0) |
| 53 | parser.add_argument( |
| 54 | '--device', |
| 55 | choices=['cpu', 'cuda'], |
| 56 | default='cuda', |
| 57 | help='device used for testing') |
| 58 | parser.add_argument( |
| 59 | '--physmode', |
| 60 | choices=['none', 'normal'], |
| 61 | default='none', |
| 62 | help='physmode') |
| 63 | parser.add_argument( |
| 64 | '--perturb', |
| 65 | choices=['false', 'true'], |
| 66 | default='false') |
| 67 | args = parser.parse_args() |
| 68 | if 'LOCAL_RANK' not in os.environ: |
| 69 | os.environ['LOCAL_RANK'] = str(args.local_rank) |
| 70 | return args |
| 71 | |
| 72 | |
| 73 | def main(): |