Skip to content

Commit 571af92

Browse files
authored
Support for UltralyticsParser. (#367)
1 parent 49a14a0 commit 571af92

File tree

7 files changed

+463
-1
lines changed

7 files changed

+463
-1
lines changed

luxonis_ml/data/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,44 @@ The supported formats are:
416416
└── test/
417417
```
418418
419+
- [**YOLOv8-v12**](https://roboflow.com/formats/yolov8-pytorch-txt) and [**Ultralytics**](https://docs.ultralytics.com/datasets/)
420+
421+
- Roboflow format (supports YOLOv8-v12)
422+
```plaintext
423+
dataset_dir/
424+
├── train/
425+
│ ├── images/
426+
│ │ ├── img1.jpg
427+
│ │ ├── img2.jpg
428+
│ │ └── ...
429+
│ ├── labels/
430+
│ │ ├── img1.txt
431+
│ │ ├── img2.txt
432+
│ │ └── ...
433+
├── valid/
434+
├── test/
435+
└── *.yaml
436+
```
437+
- Ultralytics format
438+
```plaintext
439+
dataset_dir/
440+
├── images/
441+
│ ├── train/
442+
│ │ ├── img1.jpg
443+
│ │ ├── img2.jpg
444+
│ │ └── ...
445+
│ ├── val/
446+
│ └── test/
447+
├── labels/
448+
│ ├── train/
449+
│ │ ├── img1.txt
450+
│ │ ├── img2.txt
451+
│ │ └── ...
452+
│ ├── val/
453+
│ └── test/
454+
└── *.yaml
455+
```
456+
419457
- [**Pascal VOC XML**](https://roboflow.com/formats/pascal-voc-xml)
420458
421459
```plaintext

luxonis_ml/data/parsers/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .voc_parser import VOCParser
1111
from .yolov4_parser import YoloV4Parser
1212
from .yolov6_parser import YoloV6Parser
13+
from .yolov8_parser import YOLOv8Parser
1314

1415
__all__ = [
1516
"BaseParser",
@@ -22,6 +23,7 @@
2223
"SegmentationMaskDirectoryParser",
2324
"TensorflowCSVParser",
2425
"VOCParser",
26+
"YOLOv8Parser",
2527
"YoloV4Parser",
2628
"YoloV6Parser",
2729
]

luxonis_ml/data/parsers/classification_directory_parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def validate_split(split_path: Path) -> dict[str, Any] | None:
3333
classes = [
3434
d
3535
for d in split_path.iterdir()
36-
if d.is_dir() and d.name not in {"train", "valid", "test"}
36+
if d.is_dir()
37+
and d.name not in {"train", "valid", "test", "images", "labels"}
3738
]
3839
if not classes:
3940
return None

luxonis_ml/data/parsers/luxonis_parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from .voc_parser import VOCParser
2626
from .yolov4_parser import YoloV4Parser
2727
from .yolov6_parser import YoloV6Parser
28+
from .yolov8_parser import YOLOv8Parser
2829

2930

3031
class ParserType(Enum):
@@ -48,6 +49,7 @@ class LuxonisParser(Generic[T]):
4849
DatasetType.SEGMASK: SegmentationMaskDirectoryParser,
4950
DatasetType.SOLO: SOLOParser,
5051
DatasetType.NATIVE: NativeParser,
52+
DatasetType.YOLOV8: YOLOv8Parser,
5153
}
5254

5355
def __init__(

0 commit comments

Comments
 (0)