This readme will provide, installation, training and testing instructions. Experiments for the thesis are conducted on the Lisa cluster and all installations are done in an Anaconda Environment.
Algorithms used for the thesis are:
Evaluation tools can be found in this repository. Data preparation steps can also be found in this repository, it is advised to first follow the steps there.
To install on the Lisa cluster:
-
Load modules
module load 2020 module load Anaconda3/2020.02
-
Clone the repo:
git clone https://github.com/sanderisbestok/yolov5
-
Create the environment:
conda create --name yolov5 python=3.8
-
Install requirements (check if you use the pip of the environment):
conda activate yolov5 pip install -r requirements.txt
To train we need the pre-trained YoloV5x model which can be downloaded here. Place this model in the main folder.
The following job can be used to train the network if the network is installed in ~/networks/yolov5 with the environment yolov5.
#!/bin/bash
#SBATCH -t 06:00:00
#SBATCH -p gpu
#SBATCH -N 1
#SBATCH --gpus-per-node=gtx1080ti:4
module load 2020
module load Anaconda3/2020.02
mkdir $TMPDIR/sander
cp -r $HOME/data $TMPDIR/sander/
source activate /home/hansen/.conda/envs/yolov5/
cd ~/networks/yolov5/
python train.py --img 640 --batch 16 --epochs 100000 --data ego.yaml --weights yolov5x.pt
As of this moment, validation is build into the training stage. So during the training the results will be saved.
To do the actual testing on a test database instead of validation you can use the following command
python detect.py --source ~/data/extremenet/images/test/ --weights ~/weights/experiment_1/yolov5_best.pt --conf 0.00 --save-txt --save-conf
YoloV5 visualiser can be used with the following command:
python detect.py --source path_to_image --weights path_to_model --conf 0.50
Models are saved in runs/train