diff --git a/supervision/dataset/formats/coco.py b/supervision/dataset/formats/coco.py index 76178c53..4f8679d5 100644 --- a/supervision/dataset/formats/coco.py +++ b/supervision/dataset/formats/coco.py @@ -106,7 +106,7 @@ def detections_to_coco_annotations( approximation_percentage: float = 0.75, ) -> Tuple[List[Dict], int]: coco_annotations = [] - for xyxy, mask, _, class_id, _ in detections: + for xyxy, mask, _, class_id, _, _ in detections: box_width, box_height = xyxy[2] - xyxy[0], xyxy[3] - xyxy[1] polygon = [] if mask is not None: diff --git a/supervision/dataset/formats/pascal_voc.py b/supervision/dataset/formats/pascal_voc.py index ba77ddf8..ed18d288 100644 --- a/supervision/dataset/formats/pascal_voc.py +++ b/supervision/dataset/formats/pascal_voc.py @@ -109,7 +109,7 @@ def detections_to_pascal_voc( segmented.text = "0" # Add object elements - for xyxy, mask, _, class_id, _ in detections: + for xyxy, mask, _, class_id, _, _ in detections: name = classes[class_id] if mask is not None: polygons = approximate_mask_with_polygons( diff --git a/supervision/dataset/formats/yolo.py b/supervision/dataset/formats/yolo.py index 254f034d..c8136205 100644 --- a/supervision/dataset/formats/yolo.py +++ b/supervision/dataset/formats/yolo.py @@ -194,7 +194,7 @@ def detections_to_yolo_annotations( approximation_percentage: float = 0.75, ) -> List[str]: annotation = [] - for xyxy, mask, _, class_id, _ in detections: + for xyxy, mask, _, class_id, _, _ in detections: if mask is not None: polygons = approximate_mask_with_polygons( mask=mask,