Dataset Structure Guide
This folder contains the structure required for YOLOv8 training.
What goes where?
-
Images:
- Put your training images (80% of data) in:
train/images/ - Put your validation images (20% of data) in:
val/images/ - Supported formats:
.jpg,.png,.bmp.
- Put your training images (80% of data) in:
-
Labels:
- For every image
image1.jpg, you need a text fileimage1.txtin the correspondinglabels/folder. - Example:
train/images/road_01.jpgtrain/labels/road_01.txt
- For every image
-
data.yaml:
- This file configures the dataset paths and class names.
- It is the entry point for the training script.
Label Format
YOLO expects a .txt file with one line per object:
<class_id> <x_center> <y_center> <width> <height>
- class_id: Integer (0, 1, 2...) from
data.yaml. - coordinates: Normalized between 0 and 1.
Example:
0 0.5 0.5 0.2 0.4 -> Class 0, centered in the middle, 20% width, 40% height.