Duton / yolo_1_pytorch

simplest implementation of yolo v1 via pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yolo_1_pytorch

simplest implementation of yolo v1 via pytorch √
Language: 中文
CSDN blog: 博客解析

This repo is a brief implementation of yolo v1. You can easily train the model and visualize the result.

img

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

Environment:

  • Python3
  • Pytorch>=1.3
  • cv2
  • matplotlib

Dataset preparation

  1. 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
  1. Extract all tars:
tar xvf VOCtrainval_06-Nov-2007.tar
tar xvf VOCtest_06-Nov-2007.tar
tar xvf VOCdevkit_08-Jun-2007.tar
  1. put the data into dataset/voc2007 and make the folder structure look like:
dataset
├── voc2007
│   ├── Annotations
│   ├── ImageSets
│   ├── JPEGImages
│   ├── Label
│   ├── SegmentationClass
│   └── SegmentationObject
└── voc2012
  1. fit voc dataset to yolo model as pytorch dataset format:
python fit_voc_to_yolo.py

Train

python train.py

Detect single image

python detect.py

Demo

imgs imgs

About

simplest implementation of yolo v1 via pytorch

License:MIT License


Languages

Language:Python 100.0%