Ultralytics YOLO format organizes images, labels, and dataset configuration for training an object detector such as YOLOv8. Prepare the data in this layout before wiring it into a repeatable data-preparation pipeline. section 7.3.1
Keep the configuration and files aligned:
- Set path to the dataset root; point train, val, and test to their image directories. Each split also needs a corresponding labels directory. section 7.3.1
- Match image and label basenames: images/id0042.png pairs with labels/id0042.txt. Map zero-indexed class numbers to labels under names. section 7.3.1
Listing 7.9 Configuration training YOLOv8 with a custom dataset
path: /home/jovyan/data/ train: "train/images" val: "val/images" test: "test/images" names: 0: id_card
This YOLOv8 configuration points at all three image splits and maps class 0 to id_card. section 7.3.1
When automating the split, copy images and their labels into matching split directories. Check the expected layout before implementation: detector formats do not share one universal configuration or naming convention. section 7.3.1
