Parse parameters.
()
| 21 | |
| 22 | |
| 23 | def parse_args(): |
| 24 | """Parse parameters.""" |
| 25 | parser = argparse.ArgumentParser( |
| 26 | description='MMDet test (and eval) a model') |
| 27 | parser.add_argument('config', help='test config file path') |
| 28 | parser.add_argument('checkpoint', help='checkpoint file') |
| 29 | parser.add_argument( |
| 30 | '--work-dir', |
| 31 | help='the directory to save the file containing evaluation metrics') |
| 32 | parser.add_argument('--out', help='output result file in pickle format') |
| 33 | parser.add_argument( |
| 34 | '--fuse-conv-bn', |
| 35 | action='store_true', |
| 36 | help='Whether to fuse conv and bn, this will slightly increase' |
| 37 | 'the inference speed') |
| 38 | parser.add_argument( |
| 39 | '--gpu-ids', |
| 40 | type=int, |
| 41 | nargs='+', |
| 42 | help='ids of gpus to use ' |
| 43 | '(only applicable to non-distributed testing)') |
| 44 | parser.add_argument( |
| 45 | '--format-only', |
| 46 | action='store_true', |
| 47 | help='Format the output results without perform evaluation. It is' |
| 48 | 'useful when you want to format the result to a specific format and ' |
| 49 | 'submit it to the test server') |
| 50 | parser.add_argument( |
| 51 | '--eval', |
| 52 | type=str, |
| 53 | nargs='+', |
| 54 | help='evaluation metrics, which depends on the dataset, e.g., "bbox",' |
| 55 | ' "segm", "proposal" for COCO, and "mAP", "recall" for PASCAL VOC') |
| 56 | parser.add_argument('--show', action='store_true', help='show results') |
| 57 | parser.add_argument( |
| 58 | '--show-dir', help='directory where painted images will be saved') |
| 59 | parser.add_argument( |
| 60 | '--show-score-thr', |
| 61 | type=float, |
| 62 | default=0.3, |
| 63 | help='score threshold (default: 0.3)') |
| 64 | parser.add_argument( |
| 65 | '--gpu-collect', |
| 66 | action='store_true', |
| 67 | help='whether to use gpu to collect results.') |
| 68 | parser.add_argument( |
| 69 | '--tmpdir', |
| 70 | help='tmp directory used for collecting results from multiple ' |
| 71 | 'workers, available when gpu-collect is not specified') |
| 72 | parser.add_argument( |
| 73 | '--cfg-options', |
| 74 | nargs='+', |
| 75 | action=DictAction, |
| 76 | help='override some settings in the used config, the key-value pair ' |
| 77 | 'in xxx=yyy format will be merged into config file. If the value to ' |
| 78 | 'be overwritten is a list, it should be like key="[a,b]" or key=a,b ' |
| 79 | 'It also allows nested list/tuple values, e.g. key="[(a,b),(c,d)]" ' |
| 80 | 'Note that the quotation marks are necessary and that no white space ' |