| 12 | |
| 13 | # TODO: support fuse_conv_bn and format_only |
| 14 | def parse_args(): |
| 15 | parser = argparse.ArgumentParser( |
| 16 | description='MMDet3D test (and eval) a model') |
| 17 | parser.add_argument('config', help='test config file path') |
| 18 | parser.add_argument('checkpoint', help='checkpoint file') |
| 19 | parser.add_argument( |
| 20 | '--work-dir', |
| 21 | help='the directory to save the file containing evaluation metrics') |
| 22 | parser.add_argument('--task-name', help='task names') |
| 23 | parser.add_argument('--ceph', |
| 24 | action='store_true', |
| 25 | help='Use ceph as data storage backend') |
| 26 | parser.add_argument('--show', |
| 27 | action='store_true', |
| 28 | help='show prediction results') |
| 29 | parser.add_argument('--show-dir', |
| 30 | help='directory where painted images will be saved. ' |
| 31 | 'If specified, it will be automatically saved ' |
| 32 | 'to the work_dir/timestamp/show_dir') |
| 33 | parser.add_argument('--score-thr', |
| 34 | type=float, |
| 35 | default=0.1, |
| 36 | help='bbox score threshold') |
| 37 | parser.add_argument( |
| 38 | '--task', |
| 39 | type=str, |
| 40 | choices=[ |
| 41 | 'mono_det', 'multi-view_det', 'lidar_det', 'lidar_seg', |
| 42 | 'multi-modality_det' |
| 43 | ], |
| 44 | help='Determine the visualization method depending on the task.') |
| 45 | parser.add_argument('--wait-time', |
| 46 | type=float, |
| 47 | default=2, |
| 48 | help='the interval of show (s)') |
| 49 | parser.add_argument( |
| 50 | '--cfg-options', |
| 51 | nargs='+', |
| 52 | action=DictAction, |
| 53 | help='override some settings in the used config, the key-value pair ' |
| 54 | 'in xxx=yyy format will be merged into config file. If the value to ' |
| 55 | 'be overwritten is a list, it should be like key="[a,b]" or key=a,b ' |
| 56 | 'It also allows nested list/tuple values, e.g. key="[(a,b),(c,d)]" ' |
| 57 | 'Note that the quotation marks are necessary and that no white space ' |
| 58 | 'is allowed.') |
| 59 | parser.add_argument('--launcher', |
| 60 | choices=['none', 'pytorch', 'slurm', 'mpi'], |
| 61 | default='none', |
| 62 | help='job launcher') |
| 63 | parser.add_argument('--tta', |
| 64 | action='store_true', |
| 65 | help='Test time augmentation') |
| 66 | # When using PyTorch version >= 2.0.0, the `torch.distributed.launch` |
| 67 | # will pass the `--local-rank` parameter to `tools/test.py` instead |
| 68 | # of `--local_rank`. |
| 69 | parser.add_argument('--local_rank', '--local-rank', type=int, default=0) |
| 70 | args = parser.parse_args() |
| 71 | if 'LOCAL_RANK' not in os.environ: |