Semester project done by Paolo Dimasi, Alberto Foti and Samuele Pino for the course 01URPOV - Machine learning for vision and multimedia at Politecnico of Turin.
# apt install required packages
apt update
apt install -y zip htop screen libgl1-mesa-glx
# pip install required packages
pip install -r requirements.txt
python3 test.py --data data/data.yaml --img 640 --batch 32 --conf 0.001 --iou 0.65 --device 0 --weights <path/yolov7-weight.pt> --name <your_yolov7_trained_name>
Data preparation
# train yolov7 models
python3 train.py --workers 32 --device 0 --batch-size 32 --data cfg/thermal-data.yaml --img 640 512 --cfg cfg/network/yolov7-tiny-silu.yaml --name <your_yolov7_name> --hyp data/hyp.yaml --epochs 100 --weights "''"
# finetune p5 models
python3 train.py --workers 8 --device 0 --batch-size 32 --data data/custom.yaml --img 640 512 --cfg cfg/training/yolov7-custom.yaml --weights <path/yolov7-weight.pt> --name <your_yolov7_pretrained_name> --hyp data/hyp.yaml
On video:
python3 detect.py --weights <path/yolov7-weight.pt> --conf 0.25 --img 640 --source <path/yourvideo.mp4>
On image:
python3 detect.py --weights <path/yolov7-weight.pt> --conf 0.25 --img 640 --source <path/yourimage.jpg>
As long as you cite us you are free to use it.
Expand
Copyright (C) 2022 Paolo Dimasi, Alberto Foti, Samuele Pino