---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
Cell In[78], line 1
----> 1 predicted_dataset = sv.DetectionDataset.from_yolo(
2 "/tmp/DOTAv1_small/images/val",
3 "/tmp/runs/obb/predict/labels",
4 data_yaml_path="/tmp/DOTAv1_small/data.yml",
5 is_obb=True,
6 )
File /opt/anaconda3/envs/zeel_py310/lib/python3.10/site-packages/supervision/dataset/core.py:497, in DetectionDataset.from_yolo(cls, images_directory_path, annotations_directory_path, data_yaml_path, force_masks, is_obb)
445 @classmethod
446 def from_yolo(
447 cls,
(...)
452 is_obb: bool = False,
453 ) -> DetectionDataset:
454 """
455 Creates a Dataset instance from YOLO formatted data.
456
(...)
495 ```
496 """
--> 497 classes, image_paths, annotations = load_yolo_annotations(
498 images_directory_path=images_directory_path,
499 annotations_directory_path=annotations_directory_path,
500 data_yaml_path=data_yaml_path,
501 force_masks=force_masks,
502 is_obb=is_obb,
503 )
504 return DetectionDataset(
505 classes=classes, images=image_paths, annotations=annotations
506 )
File /opt/anaconda3/envs/zeel_py310/lib/python3.10/site-packages/supervision/dataset/formats/yolo.py:182, in load_yolo_annotations(images_directory_path, annotations_directory_path, data_yaml_path, force_masks, is_obb)
180 with_masks = _with_mask(lines=lines)
181 with_masks = force_masks if force_masks else with_masks
--> 182 annotation = yolo_annotations_to_detections(
183 lines=lines,
184 resolution_wh=resolution_wh,
185 with_masks=with_masks,
186 is_obb=is_obb,
187 )
188 annotations[image_path] = annotation
189 return classes, image_paths, annotations
File /opt/anaconda3/envs/zeel_py310/lib/python3.10/site-packages/supervision/dataset/formats/yolo.py:120, in yolo_annotations_to_detections(lines, resolution_wh, with_masks, is_obb)
115 return Detections(class_id=class_id, xyxy=xyxy, data=data)
117 polygons = [
118 (polygon * np.array(resolution_wh)).astype(int) for polygon in relative_polygon
119 ]
--> 120 mask = _polygons_to_masks(polygons=polygons, resolution_wh=resolution_wh)
121 return Detections(class_id=class_id, xyxy=xyxy, data=data, mask=mask)
File /opt/anaconda3/envs/zeel_py310/lib/python3.10/site-packages/supervision/dataset/formats/yolo.py:50, in _polygons_to_masks(polygons, resolution_wh)
47 def _polygons_to_masks(
48 polygons: List[np.ndarray], resolution_wh: Tuple[int, int]
49 ) -> np.ndarray:
---> 50 return np.array(
51 [
52 polygon_to_mask(polygon=polygon, resolution_wh=resolution_wh)
53 for polygon in polygons
54 ],
55 dtype=bool,
56 )
KeyboardInterrupt: