| 26 | |
| 27 | |
| 28 | def parse_args(): |
| 29 | parser = argparse.ArgumentParser( |
| 30 | description='MMDet test (and eval) a model') |
| 31 | parser.add_argument('config', help='test config file path') |
| 32 | parser.add_argument('checkpoint', help='checkpoint file') |
| 33 | parser.add_argument('--out', help='output result file in pickle format') |
| 34 | parser.add_argument( |
| 35 | '--fuse-conv-bn', |
| 36 | action='store_true', |
| 37 | help='Whether to fuse conv and bn, this will slightly increase' |
| 38 | 'the inference speed') |
| 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( |
| 46 | '--eval', |
| 47 | type=str, |
| 48 | nargs='+', |
| 49 | help='evaluation metrics, which depends on the dataset, e.g., "bbox",' |
| 50 | ' "segm", "proposal" for COCO, and "mAP", "recall" for PASCAL VOC') |
| 51 | parser.add_argument('--show', action='store_true', help='show results') |
| 52 | parser.add_argument( |
| 53 | '--show-dir', help='directory where results 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('--seed', type=int, default=0, help='random seed') |
| 63 | parser.add_argument( |
| 64 | '--deterministic', |
| 65 | action='store_true', |
| 66 | help='whether to set deterministic options for CUDNN backend.') |
| 67 | parser.add_argument( |
| 68 | '--cfg-options', |
| 69 | nargs='+', |
| 70 | action=DictAction, |
| 71 | help='override some settings in the used config, the key-value pair ' |
| 72 | 'in xxx=yyy format will be merged into config file. If the value to ' |
| 73 | 'be overwritten is a list, it should be like key="[a,b]" or key=a,b ' |
| 74 | 'It also allows nested list/tuple values, e.g. key="[(a,b),(c,d)]" ' |
| 75 | 'Note that the quotation marks are necessary and that no white space ' |
| 76 | 'is allowed.') |
| 77 | parser.add_argument( |
| 78 | '--options', |
| 79 | nargs='+', |
| 80 | action=DictAction, |
| 81 | help='custom options for evaluation, the key-value pair in xxx=yyy ' |
| 82 | 'format will be kwargs for dataset.evaluate() function (deprecate), ' |
| 83 | 'change to --eval-options instead.') |
| 84 | parser.add_argument( |
| 85 | '--eval-options', |