Language: 中文
CSDN blog: 博客解析
This repo is a brief implementation of yolo v1. You can easily train the model and visualize the result.
output tensor: | S×S×(B∗5+C) | S: | num of grids | B: | num of boxes | C: | num of classes | |||
---|---|---|---|---|---|---|---|---|---|---|
7x7x(2*5+20) | 7 | 2 | 20 |
git clone https://github.com/leviome/yolo_1_pytorch.git
cd yolo_1_pytorch
- Python3
- Pytorch>=1.3
- cv2
- matplotlib
- Download voc2007 dataset:
wget -c http://pjreddie.com/media/files/VOCtrainval_06-Nov-2007.tar
wget -c http://pjreddie.com/media/files/VOCtest_06-Nov-2007.tar
wget -c http://pjreddie.com/media/files/VOCdevkit_08-Jun-2007.tar
- Extract all tars:
tar xvf VOCtrainval_06-Nov-2007.tar
tar xvf VOCtest_06-Nov-2007.tar
tar xvf VOCdevkit_08-Jun-2007.tar
- put the data into dataset/voc2007 and make the folder structure look like:
dataset
├── voc2007
│ ├── Annotations
│ ├── ImageSets
│ ├── JPEGImages
│ ├── Label
│ ├── SegmentationClass
│ └── SegmentationObject
└── voc2012
- fit voc dataset to yolo model as pytorch dataset format:
python fit_voc_to_yolo.py
python train.py
python detect.py