This notes that I took for target detection with yolov5. In this project, blood cancer cells were detected.
- Update pip with the following command.
$ python -m pip install --upgrade pip
- Create an enviroment.
$ conda create --name yolov5
- Activate this environment
$ conda activate yolov5
- Open the yolov5 directory
$ cd <yolov5_dir>
- Setup requirements
$ pip install -r requirements.txt
- Make sure you have cuda and cudnn installs
- Make sure environment activated. Go to yolov5 directory.
$ cd <yolov5_dir>
- Run commands below
% python train.py --img 416 --data ../data.yaml --cfg ./models/yolov5s.yaml --batch 32 --epochs 50
- You can see the training results and weights, enter the directory below in the yolov5 folder.
$ cd <yolov5_dir>/runs/train
- Run commands below
$ python detect.py --source ../dataset/test/images/ --weights ./runs/train/exp/weights/best.pt --conf 0.4
- You can see the detection results, enter the directory below in the yolov5 folder.
$ cd <yolov5_dir>/runs/detect