/YOLOv5

YOLOv5 implementation using PyTorch

Primary LanguagePython

YOLOv5 implementation using PyTorch

Demo

output1_1.mp4
output2_1.mp4

Installation

conda create -n YOLO python=3.8
conda activate YOLO
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch-lts
pip install opencv-python==4.5.5.64
pip install PyYAML
pip install tqdm

Train

  • Configure your dataset path in main.py for training
  • Run bash main.sh $ --train for training, $ is number of GPUs

Test

  • Configure your dataset path in main.py for testing
  • Run python main.py --test for testing

Inference

  • Run python main.py --demo for inference

Results & Pretrained Checkpoints

Model mAPval
50-95
mAPval
50
params
(M)
FLOPs
@640 (B)
YOLOv5n 28.0 45.7 1.9 4.5
YOLOv5s 37.4 56.8 7.2 16.5
YOLOv5m 45.4 64.1 21.2 49.0
YOLOv5l 49.0 67.3 46.5 109.1

Dataset structure

├── COCO 
    ├── images
        ├── train2017
            ├── 1111.jpg
            ├── 2222.jpg
        ├── val2017
            ├── 1111.jpg
            ├── 2222.jpg
    ├── labels
        ├── train2017
            ├── 1111.txt
            ├── 2222.txt
        ├── val2017
            ├── 1111.txt
            ├── 2222.txt

Reference