fix looping over detections in dataset loaders

This commit is contained in:
SkalskiP 2024-01-28 09:39:26 +01:00
parent 9b21231204
commit c41b68e9cb
3 changed files with 3 additions and 3 deletions

View File

@ -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:

View File

@ -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(

View File

@ -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,