Benchmarking
benchmarking
¶
Attributes¶
Classes¶
Functions:¶
evaluate_detections(detections_dict)
¶
Step 2: Compute precision and recall for each detector. Args: detections_dict (dict): Dictionary mapping image paths to a dictionary with detector names and the corresponding output boxes. Output of get_neon_detections.
Source code in tree_detection_framework/utils/benchmarking.py
get_benchmark_detections(dataset_name, images_dir, annotations_dir, detectors, nms_threshold=None, min_confidence=0.5, nms_on_polygons=False)
¶
Load ground truth, create dataloader, and run detectors on the images from the benchmark dataset. Args: dataset_name (str): Name of the dataset ("neon" or "detectree2"). images_dir (PATH_TYPE, List[PATH_TYPE]): Directory or list of directories to image files. annotations_dir (PATH_TYPE, List[PATH_TYPE]): Directory or list of directories to annotation files. detectors (dict): Dictionary of detector instances to be evaluated. nms_threshold (float): Non-maximum suppression threshold. min_confidence (float): Minimum confidence threshold for detections. nms_on_polygons (bool): Should NMS be run on polygons before converting them to bounding boxes. Defaults to False. Returns: dict: A dictionary mapping image paths to a dictionary with detector names and the corresponding output boxes.
Source code in tree_detection_framework/utils/benchmarking.py
get_detectree2_dataloader(images_dir, annotations_dir)
¶
Create a Detectree2 dataloader from one or more image/annotation directories.
Source code in tree_detection_framework/utils/benchmarking.py
get_detectree2_gt(dataloader, tile_size=1000)
¶
Extract ground truth bounding boxes from Detectree2 annotations.
Source code in tree_detection_framework/utils/benchmarking.py
get_neon_dataloader(image_paths)
¶
Create a dataloader for the NEON dataset.
Source code in tree_detection_framework/utils/benchmarking.py
get_neon_gt(images_dir, annotations_dir)
¶
Extract ground truth bounding boxes from NEON XML annotations. Args: images_dir (PATH_TYPE): Directory containing image tiles. annotations_dir (PATH_TYPE): Directory containing XML annotation files. Returns: dict: A dictionary mapping image paths to a dictionary with "gt" key containing ground truth boxes.