This repo is an implementation of the paper "Performance comparison of YOLOv7 and YOLOv8 using the YCB datasets YCB-M and YCB-Video" and can be found into the doc/paper
directory.
The trained models can be found here
This application is running in docker. There are four docker images available:
- yolov7_training
- yolov7_validation
- yolov8_training
- yolov8_validation
- To run one of these images, first build the image with following command (yolov7_training as example):
docker-compose -f docker/yolov7/v7_training_docker-compose.yml build
- After that run the image with following command
docker-compose -f docker/yolov7/v7_training_docker-compose.yml up -d
Important Hint: Please mount some volumes if necessary, if for example you need a dataset in the yolov7 training image.
To split the two datasets like I did in the paper, follow these steps:
- Download the YCB-Video and YCB-M Dataset
- Build and run the docker image of the yolov7_validation as described above.
- Add the two datasets as volume mount in the validation dataset compose.
- Adjust the
self.docker_training_dataset_path
in which both dataset are stored insrc/validation/param_singleton.py
script. - In the directory
/root/src/validation
are two scripts calledycbm_dataset.py
andycbv_dataset.py
these are used to split the datasets. - Before starting you have to adjust the paths in the inits of these scripts, e.g. where the splits has to be stored.
- Run the scripts.
The own created test dataset can be found here: RD-Dataset
- Run the yolov7_training image
- Mount the Training and Validation dataset if necessary
- Exec into the image and run
python3 train.py --workers 48 --device 0 --batch-size 40 --epochs 100 --img 640 640 --data data/custom_data.yaml --hyp data/hyp.scratch.custom.yaml --cfg cfg/training/yolov7x.yaml --name new_model_name --weights yolov7x.pt --patience 10 --save_period 1
Hint: adjust paths where the training and validation datas are in data/custom_data.yaml
- Run the yolov8_training image
- Mount the Training and Validation dataset if necessary
- Exec into the image and run
yolo mode=train task=detect model=train model=yolov8x.pt data=config/custom.yaml epochs=100 imgsz=640 batch=40 workers=48 device=0 patience=10 save_period=1 plots=True name=new_model_name
Hint: adjust paths where the training and validation datas are in config/custom.yaml
- Run the yolov7 or yolov8 validation image (depends, which has to be evaluated)
- Mount all datasets (YCB-M, YCB-Video and own created) into the docker image.
- Adjust the paths in
param_singleton.py
and add themodel_name
and the correspoding test_dataset (YCB-M, YCB-Video or combination) into themain.py
. - Run the
main.py
script with following command
python3 main.py
Hint: If there are some problems, please write an issue.
Samuel Hafner (@hafners)
Thanks to the contributors of the repo review_object_detection_metrics, who made the mAP calculation easy.