| 28 | |
| 29 | |
| 30 | def parse_args(argv=None): |
| 31 | parser = argparse.ArgumentParser( |
| 32 | description='PlaneRecNet Evaluation') |
| 33 | parser.add_argument('--trained_model', |
| 34 | default=None, type=str, |
| 35 | help='Trained state_dict file path to open. If "interrupt", this will open the interrupt file.') |
| 36 | parser.add_argument('--top_k', default=100, type=int, |
| 37 | help='Further restrict the number of predictions to parse') |
| 38 | parser.add_argument('--score_threshold', default=0.15, type=float, |
| 39 | help='Detections with a score under this threshold will not be considered.') |
| 40 | parser.add_argument("--nms_mode", default="matrix", type=str, choices=["matrix", "mask"], help='Chose NMS type from matrix and mask nms.') |
| 41 | parser.add_argument('--output_coco_json', dest='output_coco_json', action='store_true', |
| 42 | help='If display is not set, instead of processing IoU values, this just dumps detections into the coco json file.') |
| 43 | parser.add_argument('--bbox_det_file', default='results/bbox_detections.json', type=str, |
| 44 | help='The output file for coco bbox results if --coco_results is set.') |
| 45 | parser.add_argument('--mask_det_file', default='results/mask_detections.json', type=str, |
| 46 | help='The output file for coco mask results if --coco_results is set.') |
| 47 | parser.add_argument('--max_images', default=-1, type=int, |
| 48 | help='The maximum number of images from the dataset to consider. Use -1 for all.') |
| 49 | parser.add_argument('--config', default=None, |
| 50 | help='The config object to use.') |
| 51 | parser.add_argument('--no_bar', dest='no_bar', action='store_true', |
| 52 | help='Do not output the status bar. This is useful for when piping to a file.') |
| 53 | parser.add_argument('--autopsy', dest='autopsy', action='store_true', |
| 54 | help='Do not output the status bar. This is useful for when piping to a file.') |
| 55 | parser.add_argument('--dataset', default=None, type=str, |
| 56 | help='If specified, override the dataset specified in the config with this one (example: coco2017_dataset).') |
| 57 | global args |
| 58 | args = parser.parse_args(argv) |
| 59 | |
| 60 | depth_metrics = ["abs_rel", "sq_rel", "rmse", "log10", "a1", "a2", "a3", "ratio"] |
| 61 | iou_thresholds = [x / 100 for x in range(50, 100, 5)] |