| 24 | |
| 25 | |
| 26 | def parse_args(): |
| 27 | parser = argparse.ArgumentParser( |
| 28 | description='mmseg 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=('if specified, the evaluation metric results will be dumped' |
| 34 | 'into the directory as json')) |
| 35 | parser.add_argument( |
| 36 | '--aug-test', action='store_true', help='Use Flip and Multi scale aug') |
| 37 | parser.add_argument('--out', help='output result file in pickle format') |
| 38 | parser.add_argument( |
| 39 | '--format-only', |
| 40 | action='store_true', |
| 41 | help='Format the output results without perform evaluation. It is' |
| 42 | 'useful when you want to format the result to a specific format and ' |
| 43 | 'submit it to the test server') |
| 44 | parser.add_argument( |
| 45 | '--eval', |
| 46 | type=str, |
| 47 | nargs='+', |
| 48 | help='evaluation metrics, which depends on the dataset, e.g., "mIoU"' |
| 49 | ' for generic datasets, and "cityscapes" for Cityscapes') |
| 50 | parser.add_argument('--show', action='store_true', help='show results') |
| 51 | parser.add_argument( |
| 52 | '--show-dir', help='directory where painted images will be saved') |
| 53 | parser.add_argument( |
| 54 | '--gpu-collect', |
| 55 | action='store_true', |
| 56 | help='whether to use gpu to collect results.') |
| 57 | parser.add_argument( |
| 58 | '--tmpdir', |
| 59 | help='tmp directory used for collecting results from multiple ' |
| 60 | 'workers, available when gpu_collect is not specified') |
| 61 | parser.add_argument( |
| 62 | '--options', |
| 63 | nargs='+', |
| 64 | action=DictAction, |
| 65 | help="--options is deprecated in favor of --cfg_options' and it will " |
| 66 | 'not be supported in version v0.22.0. Override some settings in the ' |
| 67 | 'used config, the key-value pair in xxx=yyy format will be merged ' |
| 68 | 'into config file. If the value to be overwritten is a list, it ' |
| 69 | 'should be like key="[a,b]" or key=a,b It also allows nested ' |
| 70 | 'list/tuple values, e.g. key="[(a,b),(c,d)]" Note that the quotation ' |
| 71 | 'marks are necessary and that no white space is allowed.') |
| 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 ' |
| 81 | 'is allowed.') |
| 82 | parser.add_argument( |
| 83 | '--eval-options', |