This repository is designed for training YOLO5, YOLO7 object detection models.
Before training, please pull the Docker image which contains pre-trained YOLO5 and YOLO7 models:
docker pull timttu/yolov5-nrp:v6Note: The Docker image already includes pre-trained YOLO5 and YOLO7 models. If you don't want to train from scratch, you can directly use these pre-trained models.
Before running any training scripts, you must first run the preprocessing script to download and prepare the datasets:
bash preprocessing.shThis script will automatically download and extract:
-
Training Dataset:
car_train_split -
Test Dataset:
car_test -
Fine-tune Dataset:
finetune-all
The preprocessing.sh script will skip downloading if the datasets already exist on your machine.
After building the Docker image with the models included, you can use the pre-trained models for testing:
Model Locations in Docker Container:
- YOLOv5 models:
/workspace/yolov5/yolo5_best.ptand/workspace/yolov5/yolo5_fintune_best.pt - YOLOv7 model:
/workspace/yolov7/yolo7_best.pt
To run testing:
-
Update the dataset path in
test/test_253_dataset.yamlto point to your mounted dataset location -
Run the test script:
docker run --rm --gpus all \ -v /path/to/your/datasets:/workspace/datasets \ -v $(pwd)/test:/workspace/test \ timttu/yolov5-nrp:v6 \ python /workspace/test/test_253_local.py -
Modify
test/test_253_dataset.yamlas needed:- Change the
path:field to match your dataset location - Adjust
train:andval:paths if needed
- Change the
run_yolo5s.py- YOLO5 training scriptrun_yolo7.py- YOLO7 training scripttest_yolo5s.py- YOLO5 testing scriptpreprocessing.sh- Dataset preparation scriptCar_model_*.yaml- Model configuration filessplit_dataset/- Dataset splitting utilitiesjob & pod/- Kubernetes configuration filesYOLO5s_result/- YOLO5 training resultsYOLO7_result/- YOLO7 training results


