This project involves making custom datasets for the YOLO series and model training methods for YOLO.
Jupyter Notebook
56
24 commits
updated Oct 25, 2025
中文文档: README_CN.md | English Documentation: README.md
This project mainly completed the following work:
Install Label Studio
Label Studio is a powerful open-source data annotation platform that supports annotation for multiple data types. Compared to traditional annotation tools, it offers the following advantages:
pip install label-studio
Launch Label Studio
label-studio
After startup, it will automatically open your browser and navigate to http://localhost:8080
Create Project and Configuration
Label Studio's object detection annotation interface includes the following features:
Export Settings:
Label Studio Annotation Process:
Upload Images: Batch upload images to be annotated in the Label Studio project
Start Annotation:
Quality Control:
Export Annotation Data:
After completing annotation, export data in Label Studio:
Recommended Directory Structure:
YoloDataSets/
|——————images/
| └——————1.jpg
| └——————2.jpg
| └——————3.jpg
| └——————...
|——————Annotations/ (if using VOC/XML format)
| └——————1.xml
| └——————2.xml
| └——————3.xml
| └——————...
If Label Studio exports YOLO format, it can be used directly without conversion.
If COCO or VOC format is exported, use the following method for conversion:
Save the annotated dataset in the following structure.
YoloDataSets/
|——————images/
| └——————1.jpg
| └——————2.jpg
| └——————3.jpg
| └——————...
|——————Annotations/
| └——————1.xml
| └——————2.xml
| └——————3.xml
| └——————...
Run DataSet.py by typing the following command in the terminal.
python DataSet.py --yoloversion yolov5 --trainval_percent 0.9 --train_percent 0.9 --mainpath YoloDataSets --classes ['dog','man']
yolov6 ··· ··· ···· ['','',···]
yolov7 ··· ··· ···· ['','',···]
yolov8 ··· ··· ···· ['','',···]
yolov9 ··· ··· ···· ['','',···]
yolov10 ··· ··· ···· ['','',···]
yolov11 ··· ··· ···· ['','',···]
The meaning of each parameter in the command is as follows.
the version of YOLO, which you can choose YOLOv5, YOLOv6, YOLOv7, YOLOv8, YOLOv9, YOLOv10 and YOLOv11the total percentage of the training and validation setthe percentage of training set in training set and validation setthe root directory of the custom datasetthe name of the label, please fill in the list format according to the exampleEnter the following command in the terminal to access the folder named yolov5.
cd yolov5
Place the converted dataset in the root directory of yolov5.
Add the .yaml configuration file named data.yaml to the directory of YoloDataSets with the following content and format.
path : YoloDataSets
train: train.txt
val: val.txt
test: test.txt
# number of classes
nc: 2
# class names
names: ['dog','man']
Run the following command in the terminal, with the parameters adjusted as appropriate.
python train.py --data YoloDataSets/data.yaml --epochs 300 --weights yolov5n.pt --cfg model/yolov5n.yaml --batch-size 128
yolov5s.pt model/yolov5s.yaml 64
yolov5m.pt model/yolov5m.yaml 40
yolov5l.pt model/yolov5l.yaml 24
yolov5x.pt model/yolov5x.yaml 16
The official pre-training weights for object detection are provided as follows.
| Model | size (pixels) | mAPval 50-95 | mAPval 50 | Speed CPU b1 (ms) | Speed V100 b1 (ms) | Speed V100 b32 (ms) | params (M) | FLOPs @640 (B) |
|---|---|---|---|---|---|---|---|---|
| YOLOv5n | 640 | 28.0 | 45.7 | 45 | 6.3 | 0.6 | 1.9 | 4.5 |
| YOLOv5s | 640 | 37.4 | 56.8 | 98 | 6.4 | 0.9 | 7.2 | 16.5 |
| YOLOv5m | 640 | 45.4 | 64.1 | 224 | 8.2 | 1.7 | 21.2 | 49.0 |
| YOLOv5l | 640 | 49.0 | 67.3 | 430 | 10.1 | 2.7 | 46.5 | 109.1 |
| YOLOv5x | 640 | 50.7 | 68.9 | 766 | 12.1 | 4.8 | 86.7 | 205.7 |
| YOLOv5n6 | 1280 | 36.0 | 54.4 | 153 | 8.1 | 2.1 | 3.2 | 4.6 |
| YOLOv5m6 | 1280 | 51.3 | 69.3 | 887 | 11.1 | 6.8 | 35.7 | 50.0 |
| YOLOv5l6 | 1280 | 53.7 | 71.3 | 1784 | 15.8 | 10.5 | 76.8 | 111.4 |
| YOLOv5x6 + [TTA] | 1280 1536 | 55.0 55.8 | 72.7 72.7 | 3136 - | 26.2 - | 19.4 - | 140.7 - | 209.8 - |
Enter the following command in the terminal to access the folder named yolov6.
cd yolov6
Place the converted dataset in the root directory of yolov6.
Add the .yaml configuration file named data.yaml to the directory of YoloDataSets with the following content and format.
train: YoloDataSets/images/train # train images
val: YoloDataSets/images/val # val images
test: YoloDataSets/images/test
is_coco: False
# number of classes
nc: 2
# class names
names: ['dog','man']
Run the following command in the terminal, with the parameters adjusted as appropriate.
python tools/train.py --batch 64 --conf configs/yolov6s6_finetune.py --data YoloDataSets/data.yaml --epochs 300 --device 0
The official pre-training weights for object detection are provided as follows.
| Model | Size | mAPval 0.5:0.95 | SpeedT4 trt fp16 b1 (fps) | SpeedT4 trt fp16 b32 (fps) | Params (M) | FLOPs (G) |
|---|---|---|---|---|---|---|
| YOLOv6-N | 640 | 37.5 | 779 | 1187 | 4.7 | 11.4 |
| YOLOv6-S | 640 | 45.0 | 339 | 484 | 18.5 | 45.3 |
| YOLOv6-M | 640 | 50.0 | 175 | 226 | 34.9 | 85.8 |
| YOLOv6-L | 640 | 52.8 | 98 | 116 | 59.6 | 150.7 |
| YOLOv6-N6 | 1280 | 44.9 | 228 | 281 | 10.4 | 49.8 |
| YOLOv6-S6 | 1280 | 50.3 | 98 | 108 | 41.4 | 198.0 |
| YOLOv6-M6 | 1280 | 55.2 | 47 | 55 | 79.6 | 379.5 |
| YOLOv6-L6 | 1280 | 57.2 | 26 | 29 | 140.4 | 673.4 |
Enter the following command in the terminal to access the folder named yolov7.
cd yolov7
Place the converted dataset in the root directory of yolov7.
Add the .yaml configuration file named data.yaml to the directory of YoloDataSets with the following content and format.
train: YoloDataSets/train.txt
val: YoloDataSets/val.txt
test: YoloDataSets/test.txt
# number of classes
nc: 2
# class names
names: ['dog','man']
Run the following command in the terminal, with the parameters adjusted as appropriate.
# finetune p5 models
python train.py --workers 8 --device 0 --batch-size 32 --data YoloDataSets/data.yaml --img 640 640 --cfg cfg/training/yolov7-custom.yaml --weights 'yolov7_training.pt' --name yolov7-custom --hyp data/hyp.scratch.custom.yaml
# finetune p6 models
python train_aux.py --workers 8 --device 0 --batch-size 16 --data YoloDataSets/data.yaml --img 1280 1280 --cfg cfg/training/yolov7-w6-custom.yaml --weights 'yolov7-w6_training.pt' --name yolov7-w6-custom --hyp data/hyp.scratch.custom.yaml
The official pre-training weights for object detection are provided as follows.
Step 1: Clone Ultralytics Repository
Execute the following commands in the project root directory to pull the latest Ultralytics YOLO framework:
git clone https://github.com/ultralytics/ultralytics.git Ultralytics
cd Ultralytics
Or download directly from the official website: Ultralytics YOLO
Step 2: Install Dependencies
pip install ultralytics
Or install full dependencies:
pip install -r requirements.txt
Step 3: Prepare Dataset
Place the converted dataset in the Ultralytics folder and add the .yaml configuration file named data.yaml to the YoloDataSets directory with the following content and format.
path : YoloDataSets # Note: Path relative to Ultralytics folder
train: train.txt
val: val.txt
test: test.txt
# number of classes
nc: 2
# class names
names: ['dog','man']
Step 4: Start Training
Method 1: Python API Training (Recommended)
Create training script train_custom.py in the Ultralytics folder:
from ultralytics import YOLO
# Load model
# YOLOv8: yolov8n.pt, yolov8s.pt, yolov8m.pt, yolov8l.pt, yolov8x.pt
# YOLOv9: yolov9c.pt, yolov9e.pt
# YOLOv10: yolov10n.pt, yolov10s.pt, yolov10m.pt, yolov10b.pt, yolov10l.pt, yolov10x.pt
# YOLOv11: yolov11n.pt, yolov11s.pt, yolov11m.pt, yolov11l.pt, yolov11x.pt
model = YOLO('yolov8n.pt') # Can be replaced with other versions
# Train the model
results = model.train(
data='YoloDataSets/data.yaml',
epochs=100,
imgsz=640,
batch=16,
device=0,
project='runs/train',
name='custom_dataset'
)
# Validate the model
metrics = model.val()
print(f"mAP50-95: {metrics.box.map:.4f}")
Run training:
python train_custom.py
from ultralytics import YOLO
# Load model
# YOLOv8: yolov8n.pt, yolov8s.pt, yolov8m.pt, yolov8l.pt, yolov8x.pt
# YOLOv9: yolov9c.pt, yolov9e.pt
# YOLOv10: yolov10n.pt, yolov10s.pt, yolov10m.pt, yolov10b.pt, yolov10l.pt, yolov10x.pt
# YOLOv11: yolov11n.pt, yolov11s.pt, yolov11m.pt, yolov11l.pt, yolov11x.pt
model = YOLO('yolov8n.pt') # Can be replaced with other versions
# Train the model
results = model.train(
data='YoloDataSets/data.yaml',
epochs=300,
imgsz=640,
batch=16,
device=0,
project='runs/train',
name='ultralytics_custom'
)
Run training:
python train_ultralytics.py
Method 2: Command Line Training
# YOLOv8 series
yolo task=detect mode=train model=yolov8n.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov8s.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov8m.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov8l.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov8x.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
# YOLOv9 series
yolo task=detect mode=train model=yolov9c.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov9e.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
# YOLOv10 series
yolo task=detect mode=train model=yolov10n.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov10s.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov10m.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov10b.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov10l.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov10x.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
# YOLOv11 series
yolo task=detect mode=train model=yolov11n.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov11s.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov11m.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov11l.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov11x.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
Project Structure:
After completing the above steps, your project directory structure should be as follows:
YOLO-Datasets-And-Training-Methods/
├── assets/
├── yolov5/
├── yolov6/
├── yolov7/
├── Ultralytics/ # Newly cloned Ultralytics repository
│ ├── ultralytics/ # Core framework
│ ├── YoloDataSets/ # Your dataset
│ │ ├── data.yaml # Dataset configuration
│ │ ├── images/
│ │ ├── labels/
│ │ ├── train.txt
│ │ ├── val.txt
│ │ └── test.txt
│ ├── train_custom.py # Your training script
│ └── runs/ # Training results
├── DataSet.py
└── README.md
Important Notes:
model parameterAdditional Features:
# Inference
model = YOLO('runs/train/custom_dataset/weights/best.pt')
results = model('path/to/image.jpg')
# Validation
metrics = model.val(data='YoloDataSets/data.yaml')
# Export
model.export(format='onnx') # Support multiple formats
| [**YOLOv8x**](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x.pt) | 640 | 53.9 | 479.1 | 3.53 | 68.2 | 257.8 |
This project involves making custom datasets for the YOLO series and model training methods for YOLO.
Jupyter Notebook
56
24 commits
updated Oct 25, 2025
中文文档: README_CN.md | English Documentation: README.md
This project mainly completed the following work:
Install Label Studio
Label Studio is a powerful open-source data annotation platform that supports annotation for multiple data types. Compared to traditional annotation tools, it offers the following advantages:
pip install label-studio
Launch Label Studio
label-studio
After startup, it will automatically open your browser and navigate to http://localhost:8080
Create Project and Configuration
Label Studio's object detection annotation interface includes the following features:
Export Settings:
Label Studio Annotation Process:
Upload Images: Batch upload images to be annotated in the Label Studio project
Start Annotation:
Quality Control:
Export Annotation Data:
After completing annotation, export data in Label Studio:
Recommended Directory Structure:
YoloDataSets/
|——————images/
| └——————1.jpg
| └——————2.jpg
| └——————3.jpg
| └——————...
|——————Annotations/ (if using VOC/XML format)
| └——————1.xml
| └——————2.xml
| └——————3.xml
| └——————...
If Label Studio exports YOLO format, it can be used directly without conversion.
If COCO or VOC format is exported, use the following method for conversion:
Save the annotated dataset in the following structure.
YoloDataSets/
|——————images/
| └——————1.jpg
| └——————2.jpg
| └——————3.jpg
| └——————...
|——————Annotations/
| └——————1.xml
| └——————2.xml
| └——————3.xml
| └——————...
Run DataSet.py by typing the following command in the terminal.
python DataSet.py --yoloversion yolov5 --trainval_percent 0.9 --train_percent 0.9 --mainpath YoloDataSets --classes ['dog','man']
yolov6 ··· ··· ···· ['','',···]
yolov7 ··· ··· ···· ['','',···]
yolov8 ··· ··· ···· ['','',···]
yolov9 ··· ··· ···· ['','',···]
yolov10 ··· ··· ···· ['','',···]
yolov11 ··· ··· ···· ['','',···]
The meaning of each parameter in the command is as follows.
the version of YOLO, which you can choose YOLOv5, YOLOv6, YOLOv7, YOLOv8, YOLOv9, YOLOv10 and YOLOv11the total percentage of the training and validation setthe percentage of training set in training set and validation setthe root directory of the custom datasetthe name of the label, please fill in the list format according to the exampleEnter the following command in the terminal to access the folder named yolov5.
cd yolov5
Place the converted dataset in the root directory of yolov5.
Add the .yaml configuration file named data.yaml to the directory of YoloDataSets with the following content and format.
path : YoloDataSets
train: train.txt
val: val.txt
test: test.txt
# number of classes
nc: 2
# class names
names: ['dog','man']
Run the following command in the terminal, with the parameters adjusted as appropriate.
python train.py --data YoloDataSets/data.yaml --epochs 300 --weights yolov5n.pt --cfg model/yolov5n.yaml --batch-size 128
yolov5s.pt model/yolov5s.yaml 64
yolov5m.pt model/yolov5m.yaml 40
yolov5l.pt model/yolov5l.yaml 24
yolov5x.pt model/yolov5x.yaml 16
The official pre-training weights for object detection are provided as follows.
| Model | size (pixels) | mAPval 50-95 | mAPval 50 | Speed CPU b1 (ms) | Speed V100 b1 (ms) | Speed V100 b32 (ms) | params (M) | FLOPs @640 (B) |
|---|---|---|---|---|---|---|---|---|
| YOLOv5n | 640 | 28.0 | 45.7 | 45 | 6.3 | 0.6 | 1.9 | 4.5 |
| YOLOv5s | 640 | 37.4 | 56.8 | 98 | 6.4 | 0.9 | 7.2 | 16.5 |
| YOLOv5m | 640 | 45.4 | 64.1 | 224 | 8.2 | 1.7 | 21.2 | 49.0 |
| YOLOv5l | 640 | 49.0 | 67.3 | 430 | 10.1 | 2.7 | 46.5 | 109.1 |
| YOLOv5x | 640 | 50.7 | 68.9 | 766 | 12.1 | 4.8 | 86.7 | 205.7 |
| YOLOv5n6 | 1280 | 36.0 | 54.4 | 153 | 8.1 | 2.1 | 3.2 | 4.6 |
| YOLOv5m6 | 1280 | 51.3 | 69.3 | 887 | 11.1 | 6.8 | 35.7 | 50.0 |
| YOLOv5l6 | 1280 | 53.7 | 71.3 | 1784 | 15.8 | 10.5 | 76.8 | 111.4 |
| YOLOv5x6 + [TTA] | 1280 1536 | 55.0 55.8 | 72.7 72.7 | 3136 - | 26.2 - | 19.4 - | 140.7 - | 209.8 - |
Enter the following command in the terminal to access the folder named yolov6.
cd yolov6
Place the converted dataset in the root directory of yolov6.
Add the .yaml configuration file named data.yaml to the directory of YoloDataSets with the following content and format.
train: YoloDataSets/images/train # train images
val: YoloDataSets/images/val # val images
test: YoloDataSets/images/test
is_coco: False
# number of classes
nc: 2
# class names
names: ['dog','man']
Run the following command in the terminal, with the parameters adjusted as appropriate.
python tools/train.py --batch 64 --conf configs/yolov6s6_finetune.py --data YoloDataSets/data.yaml --epochs 300 --device 0
The official pre-training weights for object detection are provided as follows.
| Model | Size | mAPval 0.5:0.95 | SpeedT4 trt fp16 b1 (fps) | SpeedT4 trt fp16 b32 (fps) | Params (M) | FLOPs (G) |
|---|---|---|---|---|---|---|
| YOLOv6-N | 640 | 37.5 | 779 | 1187 | 4.7 | 11.4 |
| YOLOv6-S | 640 | 45.0 | 339 | 484 | 18.5 | 45.3 |
| YOLOv6-M | 640 | 50.0 | 175 | 226 | 34.9 | 85.8 |
| YOLOv6-L | 640 | 52.8 | 98 | 116 | 59.6 | 150.7 |
| YOLOv6-N6 | 1280 | 44.9 | 228 | 281 | 10.4 | 49.8 |
| YOLOv6-S6 | 1280 | 50.3 | 98 | 108 | 41.4 | 198.0 |
| YOLOv6-M6 | 1280 | 55.2 | 47 | 55 | 79.6 | 379.5 |
| YOLOv6-L6 | 1280 | 57.2 | 26 | 29 | 140.4 | 673.4 |
Enter the following command in the terminal to access the folder named yolov7.
cd yolov7
Place the converted dataset in the root directory of yolov7.
Add the .yaml configuration file named data.yaml to the directory of YoloDataSets with the following content and format.
train: YoloDataSets/train.txt
val: YoloDataSets/val.txt
test: YoloDataSets/test.txt
# number of classes
nc: 2
# class names
names: ['dog','man']
Run the following command in the terminal, with the parameters adjusted as appropriate.
# finetune p5 models
python train.py --workers 8 --device 0 --batch-size 32 --data YoloDataSets/data.yaml --img 640 640 --cfg cfg/training/yolov7-custom.yaml --weights 'yolov7_training.pt' --name yolov7-custom --hyp data/hyp.scratch.custom.yaml
# finetune p6 models
python train_aux.py --workers 8 --device 0 --batch-size 16 --data YoloDataSets/data.yaml --img 1280 1280 --cfg cfg/training/yolov7-w6-custom.yaml --weights 'yolov7-w6_training.pt' --name yolov7-w6-custom --hyp data/hyp.scratch.custom.yaml
The official pre-training weights for object detection are provided as follows.
Step 1: Clone Ultralytics Repository
Execute the following commands in the project root directory to pull the latest Ultralytics YOLO framework:
git clone https://github.com/ultralytics/ultralytics.git Ultralytics
cd Ultralytics
Or download directly from the official website: Ultralytics YOLO
Step 2: Install Dependencies
pip install ultralytics
Or install full dependencies:
pip install -r requirements.txt
Step 3: Prepare Dataset
Place the converted dataset in the Ultralytics folder and add the .yaml configuration file named data.yaml to the YoloDataSets directory with the following content and format.
path : YoloDataSets # Note: Path relative to Ultralytics folder
train: train.txt
val: val.txt
test: test.txt
# number of classes
nc: 2
# class names
names: ['dog','man']
Step 4: Start Training
Method 1: Python API Training (Recommended)
Create training script train_custom.py in the Ultralytics folder:
from ultralytics import YOLO
# Load model
# YOLOv8: yolov8n.pt, yolov8s.pt, yolov8m.pt, yolov8l.pt, yolov8x.pt
# YOLOv9: yolov9c.pt, yolov9e.pt
# YOLOv10: yolov10n.pt, yolov10s.pt, yolov10m.pt, yolov10b.pt, yolov10l.pt, yolov10x.pt
# YOLOv11: yolov11n.pt, yolov11s.pt, yolov11m.pt, yolov11l.pt, yolov11x.pt
model = YOLO('yolov8n.pt') # Can be replaced with other versions
# Train the model
results = model.train(
data='YoloDataSets/data.yaml',
epochs=100,
imgsz=640,
batch=16,
device=0,
project='runs/train',
name='custom_dataset'
)
# Validate the model
metrics = model.val()
print(f"mAP50-95: {metrics.box.map:.4f}")
Run training:
python train_custom.py
from ultralytics import YOLO
# Load model
# YOLOv8: yolov8n.pt, yolov8s.pt, yolov8m.pt, yolov8l.pt, yolov8x.pt
# YOLOv9: yolov9c.pt, yolov9e.pt
# YOLOv10: yolov10n.pt, yolov10s.pt, yolov10m.pt, yolov10b.pt, yolov10l.pt, yolov10x.pt
# YOLOv11: yolov11n.pt, yolov11s.pt, yolov11m.pt, yolov11l.pt, yolov11x.pt
model = YOLO('yolov8n.pt') # Can be replaced with other versions
# Train the model
results = model.train(
data='YoloDataSets/data.yaml',
epochs=300,
imgsz=640,
batch=16,
device=0,
project='runs/train',
name='ultralytics_custom'
)
Run training:
python train_ultralytics.py
Method 2: Command Line Training
# YOLOv8 series
yolo task=detect mode=train model=yolov8n.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov8s.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov8m.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov8l.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov8x.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
# YOLOv9 series
yolo task=detect mode=train model=yolov9c.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov9e.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
# YOLOv10 series
yolo task=detect mode=train model=yolov10n.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov10s.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov10m.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov10b.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov10l.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov10x.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
# YOLOv11 series
yolo task=detect mode=train model=yolov11n.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov11s.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov11m.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov11l.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
yolo task=detect mode=train model=yolov11x.pt data=YoloDataSets/data.yaml batch=16 epochs=300 imgsz=640 device=0
Project Structure:
After completing the above steps, your project directory structure should be as follows:
YOLO-Datasets-And-Training-Methods/
├── assets/
├── yolov5/
├── yolov6/
├── yolov7/
├── Ultralytics/ # Newly cloned Ultralytics repository
│ ├── ultralytics/ # Core framework
│ ├── YoloDataSets/ # Your dataset
│ │ ├── data.yaml # Dataset configuration
│ │ ├── images/
│ │ ├── labels/
│ │ ├── train.txt
│ │ ├── val.txt
│ │ └── test.txt
│ ├── train_custom.py # Your training script
│ └── runs/ # Training results
├── DataSet.py
└── README.md
Important Notes:
model parameterAdditional Features:
# Inference
model = YOLO('runs/train/custom_dataset/weights/best.pt')
results = model('path/to/image.jpg')
# Validation
metrics = model.val(data='YoloDataSets/data.yaml')
# Export
model.export(format='onnx') # Support multiple formats
| [**YOLOv8x**](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x.pt) | 640 | 53.9 | 479.1 | 3.53 | 68.2 | 257.8 |