Data & convert¶
Bring a YOLO detection dataset into the COCO layout DFINE.train(data=...) consumes.
dfine.convert.yolo_to_coco ¶
yolo_to_coco(yolo_root: str | PathLike, output_dir: str | PathLike, *, class_names: list[str] | None = None, splits: dict[str, str] | None = None, copy_images: bool = True, split_names: dict[str, str] | None = None) -> dict[str, str]
Convert a YOLO detection dataset to the COCO layout under output_dir.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
yolo_root
|
str | PathLike
|
dataset root (with |
required |
output_dir
|
str | PathLike
|
where the COCO |
required |
class_names
|
list[str] | None
|
class names (index = class id). Falls back to |
None
|
splits
|
dict[str, str] | None
|
explicit |
None
|
copy_images
|
bool
|
copy images (default) or symlink them into the output. |
True
|
split_names
|
dict[str, str] | None
|
override the split→folder map (default |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
|