| 18 | |
| 19 | |
| 20 | def parse_args(): |
| 21 | parser = argparse.ArgumentParser(description='mmtrack test model') |
| 22 | parser.add_argument('config', help='test config file path') |
| 23 | parser.add_argument('--checkpoint', help='checkpoint file') |
| 24 | parser.add_argument('--out', help='output result file') |
| 25 | parser.add_argument( |
| 26 | '--work-dir', |
| 27 | help='the directory to save the file containing evaluation metrics') |
| 28 | parser.add_argument( |
| 29 | '--fuse-conv-bn', |
| 30 | action='store_true', |
| 31 | help='Whether to fuse conv and bn, this will slightly increase' |
| 32 | 'the inference speed') |
| 33 | parser.add_argument( |
| 34 | '--gpu-id', |
| 35 | type=int, |
| 36 | default=0, |
| 37 | help='id of gpu to use ' |
| 38 | '(only applicable to non-distributed testing)') |
| 39 | parser.add_argument( |
| 40 | '--format-only', |
| 41 | action='store_true', |
| 42 | help='Format the output results without perform evaluation. It is' |
| 43 | 'useful when you want to format the result to a specific format and ' |
| 44 | 'submit it to the test server') |
| 45 | parser.add_argument('--eval', type=str, nargs='+', help='eval types') |
| 46 | parser.add_argument('--show', action='store_true', help='show results') |
| 47 | parser.add_argument( |
| 48 | '--show-score-thr', |
| 49 | type=float, |
| 50 | default=0.3, |
| 51 | help='score threshold (default: 0.3)') |
| 52 | parser.add_argument( |
| 53 | '--show-dir', help='directory where painted images will be saved') |
| 54 | parser.add_argument( |
| 55 | '--gpu-collect', |
| 56 | action='store_true', |
| 57 | help='whether to use gpu to collect results.') |
| 58 | parser.add_argument( |
| 59 | '--tmpdir', |
| 60 | help='tmp directory used for collecting results from multiple ' |
| 61 | 'workers, available when gpu-collect is not specified') |
| 62 | parser.add_argument( |
| 63 | '--cfg-options', |
| 64 | nargs='+', |
| 65 | action=DictAction, |
| 66 | help='override some settings in the used config, the key-value pair ' |
| 67 | 'in xxx=yyy format will be merged into config file.') |
| 68 | parser.add_argument( |
| 69 | '--eval-options', |
| 70 | nargs='+', |
| 71 | action=DictAction, |
| 72 | help='custom options for evaluation, the key-value pair in xxx=yyy ' |
| 73 | 'format will be kwargs for dataset.evaluate() function') |
| 74 | parser.add_argument( |
| 75 | '--launcher', |
| 76 | choices=['none', 'pytorch', 'slurm', 'mpi'], |
| 77 | default='none', |