find-above-iou-threshold: Find Overlapping Bounding Boxes¶
The find-above-iou-threshold command identifies Pascal VOC annotation files that contain overlapping bounding boxes with an Intersection over Union (IoU) value above a specified threshold. This is useful for finding potential duplicate annotations or objects that significantly overlap each other.
Usage¶
Parameters¶
VOC_DIR: Directory containing Pascal VOC XML annotation filesTHRESHOLD: IoU threshold value (0.0 - 1.0) above which overlaps are reported--label-match: (Optional) Only consider boxes with the same class label as potential duplicates
IoU Explanation¶
The Intersection over Union (IoU) metric measures the overlap between two bounding boxes:
- IoU = (Area of Intersection) / (Area of Union)
- Values range from 0.0 (no overlap) to 1.0 (perfect overlap)
- Higher values indicate more significant overlap
IoU Thresholds
- Values around 0.5 are good for finding significant overlaps
- Values below 0.3 may flag normal adjacent objects
- Values above 0.8 will only detect nearly identical boxes
How It Works¶
- The command scans all XML files in the specified directory
- For each file, it:
- Parses the bounding boxes from the Pascal VOC format
- Computes IoU between each pair of boxes
- Flags the file if any IoU exceeds the threshold
- Paths to files containing overlapping boxes are output to the console
Output¶
The command simply prints the paths of files with overlapping boxes to stdout. This output can be redirected to a file or piped to another command for further processing.
Processing Results
Since this command outputs only filenames, you can easily pipe the results to other tools:
Examples¶
Find annotations with any overlapping boxes above 0.5 IoU:
Find only same-class overlapping boxes above 0.7 IoU:
Save list of files with overlapping boxes to review later: