Expand description
COCO dataset verification utilities.
Provides functions for comparing COCO datasets and validating annotation accuracy using Hungarian matching for optimal annotation pairing.
Structs§
- Bbox
Validation Result - Bounding box validation results.
- Category
Validation Result - Category validation results.
- Mask
Validation Result - Segmentation mask validation results.
- Segmentation
Pair Comparison - Result of comparing a single segmentation pair.
- Verification
Result - Result of verifying a COCO import against Studio data.
Functions§
- bbox_
iou - Calculate Intersection over Union (IoU) for two COCO bboxes. COCO bbox format: [x, y, width, height] (top-left corner)
- build_
annotation_ map_ by_ name - Build a map of annotations by sample name for efficient lookup.
- compare_
segmentation_ pair - Compare two segmentations and return comparison metrics.
- compute_
segmentation_ area - Calculate total area of a segmentation.
- count_
polygon_ parts - Count number of polygon parts in a segmentation.
- count_
polygon_ vertices - Count total polygon vertices in a segmentation.
- hungarian_
match - Use Hungarian algorithm to find optimal matching between two sets of annotations based on bounding box IoU. Returns pairs of (original_idx, restored_idx) for matched annotations.
- polygon_
area - Calculate polygon area using the Shoelace formula. Takes coordinates as flat array [x1, y1, x2, y2, …]
- polygon_
bounds - Calculate bounding box of a polygon (min_x, min_y, max_x, max_y)
- segmentation_
bbox_ iou - Calculate IoU between two segmentation bounding boxes.
- segmentation_
bounds - Get bounding box for any segmentation type.
- validate_
bboxes - Validate bounding boxes between two datasets using Hungarian matching.
- validate_
categories - Validate categories between two datasets.
- validate_
masks - Validate segmentation masks between two datasets using Hungarian matching.