diff --git a/examples/swimming-pool-detection/GE/config_GE.yaml b/examples/swimming-pool-detection/GE/config_GE.yaml index 9f27030..69379f7 100644 --- a/examples/swimming-pool-detection/GE/config_GE.yaml +++ b/examples/swimming-pool-detection/GE/config_GE.yaml @@ -57,7 +57,8 @@ make_predictions.py: detectron2_config_file: '../detectron2_config_GE.yaml' # path relative to the working_folder model_weights: pth_file: 'logs/model_final.pth' - + score_lower_threshold: 0.05 + assess_predictions.py: datasets: ground_truth_labels_geojson: output_GE/ground_truth_labels.geojson diff --git a/scripts/make_predictions.py b/scripts/make_predictions.py index cccf9ef..f9ef570 100644 --- a/scripts/make_predictions.py +++ b/scripts/make_predictions.py @@ -66,7 +66,8 @@ WORKING_DIR = cfg['working_folder'] SAMPLE_TAGGED_IMG_SUBDIR = cfg['sample_tagged_img_subfolder'] LOG_SUBDIR = cfg['log_subfolder'] - + + SCORE_LOWER_THR = cfg['score_lower_threshold'] os.chdir(WORKING_DIR) # let's make the output directories in case they don't exist @@ -89,14 +90,15 @@ cfg.OUTPUT_DIR = LOG_SUBDIR cfg.MODEL.WEIGHTS = MODEL_PTH_FILE - predictor = DefaultPredictor(cfg) - - # ---- make predictions - threshold = 0.05 + + # set the testing threshold for this model + threshold = SCORE_LOWER_THR threshold_str = str( round(threshold, 2) ).replace('.', 'dot') + cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = threshold - cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = threshold # set the testing threshold for this model + predictor = DefaultPredictor(cfg) + # ---- make predictions for dataset in COCO_FILES_DICT.keys(): predictions = {}