tlc.core.export.exporters.yoloΒΆ
Exporter for the YOLO format.
Module ContentsΒΆ
ClassesΒΆ
Class |
Description |
|---|---|
Exporter for the YOLO format. |
APIΒΆ
- class YOLOExporterΒΆ
Bases:
tlc.core.export.exporter.ExporterExporter for the YOLO format.
YOLO format writes:
One label file per image (only if there are labels)
A dataset YAML configuration file
Optionally copies/moves/symlinks images to the output directory
The exporter supports:
Detection (bounding boxes)
Segmentation (polygons)
Pose (keypoints)
Oriented bounding boxes (OBB)
Additive exports are supported: you can export multiple tables to the same output directory by calling export_yolo() multiple times with different split names. Each split must have matching category mappings. Example:
train_table.export(output_url="./dataset", format="yolo", split="train") val_table.export(output_url="./dataset", format="yolo", split="val")
Output directory structure:
<output_url>/ βββ <dataset.yaml βββ images/ β βββ train/ β β βββ image1.jpg β β βββ ... β βββ val/ β βββ ... βββ labels/ βββ train/ β βββ image1.txt β βββ ... βββ val/ βββ ...- classmethod can_export( ) boolΒΆ
Check if the table can be exported to the YOLO format.
YOLO export requires:
A bounding box, segmentation, keypoints, or OBB column
An output URL that is a directory (no extension or empty extension)
- classmethod export_yolo(
- table: Table,
- output_url: Url,
- weight_threshold: float = 0.0,
- split: str = 'train',
- image_strategy: Literal[ignore, copy, move, symlink] = 'ignore',
- image_column_name: str | None = None,
- annotation_column_name: str | None = None,
- dataset_name: str = 'dataset',
- **kwargs: Any,
Export a table to YOLO format.
- Parameters:
table β The table to export.
output_url β The directory URL to export to.
weight_threshold β The weight threshold for filtering rows.
split β The name of the split (e.g., βtrainβ, βvalβ, βtestβ). Defaults to βtrainβ.
image_strategy β How to handle images. Options are: - βignoreβ: Do not copy or symlink images (default). - βcopyβ: Copy images to the output directory. - βmoveβ: Move images to the output directory. - βsymlinkβ: Create symlinks to images. Only works for local file URLs. Not supported on Windows.
image_column_name β The column containing image URLs. Defaults to βimageβ.
annotation_column_name β The column containing annotations. Auto-detected if not provided.
dataset_name β The name for the dataset YAML file. Defaults to βdatasetβ.
**kwargs β Additional arguments (ignored).
- priority = 2ΒΆ
- supported_format = yoloΒΆ