yolov8_parser
最后更新
luxonis_ml.data.parsers.yolov8_parser类
Format
属性
ROBOFLOW
ULTRALYTICS
images/labels 布局。YOLOv8Parser
Text
1dataset_dir/
2├── images/
3│ ├── train/
4│ │ ├── img1.jpg
5│ │ ├── img2.jpg
6│ │ └── ...
7│ ├── val/
8│ └── test/
9├── labels/
10│ ├── train/
11│ │ ├── img1.txt
12│ │ ├── img2.txt
13│ │ └── ...
14│ ├── val/
15│ └── test/
16└── *.yaml
17
18OR::
19
20dataset_dir/
21├── train/
22│ ├── images/
23│ │ ├── img1.jpg
24│ │ ├── img2.jpg
25│ │ └── ...
26│ ├── labels/
27│ │ ├── img1.txt
28│ │ ├── img2.txt
29│ │ └── ...
30├── valid/
31│ ├── images/
32│ │ ├── img1.txt
33│ │ ├── img2.txt
34│ │ └── ...
35│ ├── labels/
36│ │ ├── img1.txt
37│ │ ├── img2.txt
38│ │ └── ...
39├── test/
40│ ├── images/
41│ │ ├── img1.txt
42│ │ ├── img2.txt
43│ │ └── ...
44│ ├── labels/
45│ │ ├── img1.txt
46│ │ ├── img2.txt
47│ │ └── ...
48└── *.yaml*.yaml 包含所有类名。这是 Roboflow 可以生成的一种格式。方法
discover_dir_splits
Python
1def discover_dir_splits(dataset_dir: Path) -> dict[str, dict[str, Any]]:fit_boundingbox
Python
1def fit_boundingbox(points: np.ndarray) -> dict[str, float]:from_dir
Python
1def from_dir(dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]:dataset_dir(Path): 包含分割文件夹和一个类 YAML 文件的源数据集目录。
tuple[list[Path], list[Path], list[Path]]: 训练、验证和测试分割的添加图像。
ValueError: 如果数据集目录不包含类 YAML 文件。
from_split
Python
1def from_split(image_dir: Path, annotation_dir: Path, classes_path: Path) -> ParserOutput:image_dir(Path): 包含图像的目录。annotation_dir(Path): 包含注释的目录。classes_path(Path): 包含类名的 YAML 文件。
ParserOutput: 包含注释记录、骨架元数据和添加图像的解析器输出。
validate
Python
1def validate(dataset_dir: Path) -> bool:dataset_dir(Path): 源数据集目录。
bool: 数据集是否为预期格式。
validate_split
Python
1def validate_split(split_path: Path) -> dict[str, Any] | None:split_path(Path): 分割目录的路径。
dict[str, Any] | None:from_split的关键字参数,如果分割不是预期格式,则为None。