classification_directory_parser
最后更新
luxonis_ml.data.parsers.classification_directory_parser类
ClassificationDirectoryParser
Text
1dataset_dir/
2├── train/
3│ ├── class1/
4│ │ ├── img1.jpg
5│ │ ├── img2.jpg
6│ │ └── ...
7│ ├── class2/
8│ └── ...
9├── valid/
10└── test/Text
1dataset_dir/
2├── class1/
3│ ├── img1.jpg
4│ └── ...
5├── class2/
6│ └── ...
7└── info.json (可选元数据文件)方法
from_dir
Python
1def from_dir(dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]:dataset_dir(Path): 源数据集目录。**kwargs: 额外的解析器特定参数。
tuple[list[Path], list[Path], list[Path]]: 训练、验证和测试拆分中添加的图像。
from_split
Python
1def from_split(class_dir: Path) -> ParserOutput:class_dir(Path): 顶级类目录。
ParserOutput: 包含注释记录、骨架元数据和添加图像的解析器输出。
validate_split
Python
1def validate_split(split_path: Path) -> dict[str, Any] | None:split_path(Path): 拆分目录的路径。
dict[str, Any] | None:from_split的关键字参数,如果拆分不符合预期格式,则为None。