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