Merge pull request #798 from roboflow/fix/iterating-over-detections-in-detaset-loaders

fix looping over detections in dataset loaders
This commit is contained in:
Piotr Skalski authored and GitHub committed 2024-01-28 09:46:09 +01:00
commit a44c76563e
3 files changed
+3 -3

No files matched your search

+1 -1
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:
+1 -1
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(
+1 -1
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,