## Yolov2 Pytorch Implementation
This repository aims to learn and understand the YOLO algorithm. I am a beginner of deep learning, and I found the best way to learn a deep learning algorithm is to implement it from scratch. So if you also feel this way, just follow this repo! The code in this projects is clear and easier to understand, and I also documented it as much as possible.
<div style="color:#0000FF" align="center">
<img src="images/result3.png" width="350"/>
<img src="images/result1.png" width="350"/>
</div>
## Purpose
- [x] train pascal voc
- [x] multi-GPUs support
- [x] test
- [x] pascal voc validation
- [x] data augmentation
- [x] pretrained network
- [x] reorg layer
- [x] multi-scale training
- [ ] reproduce original paper's mAP
## Main Results
| | training set | test set | mAP@416 | mAP@544 |
| :--: | :--: | :--: | :--: | :--: |
|this repo|VOC2007+2012|VOC2007|72.7|74.6|
|original paper|VOC2007+2012|VOC2007|76.8|78.6|
Running time: ~19ms (52FPS) on GTX 1080
## Prerequisites
- python 3.5.x
- pytorch 0.4.1
- tensorboardX
- opencv3
- pillow
## Preparation
First clone the code
git clone https://github.com/tztztztztz/yolov2.pytorch.git
Install dependencies
pip install -r requirements.txt
Then create some folder
mkdir output
mkdir data
## Demo
Download the pretrained weights
```
wget http://pjreddie.com/media/files/yolo-voc.weights
```
You can run the demo with `cpu` mode
python demo.py
Or with `gpu` mode
python demo.py --cuda true
## Training on PASCAL VOC
### Prepare the data
1. Download the training data.
```bash
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCdevkit_08-Jun-2007.tar
# download 2012 data
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
```
2. Extract the training data, all the data will be in one directory named `VOCdevit`. We use `$VOCdevit` to represent
the data root path
```bash
tar xvf VOCtrainval_06-Nov-2007.tar
tar xvf VOCtest_06-Nov-2007.tar
tar xvf VOCdevkit_08-Jun-2007.tar
# 2012 data
tar xvf VOCtrainval_11-May-2012.tar
```
3. It should have this basic structure
```
$VOCdevkit/ # development kit
$VOCdevkit/VOCcode/ # VOC utility code
$VOCdevkit/VOC2007 # image sets, annotations, etc.
```
4. Create symlinks for the PASCAL VOC dataset
```
cd yolov2.pytorch
mkdir data
cd data
mkdir VOCdevkit2007
cd VOCdevkit2007
ln -s $VOCdevit/VOC2007 VOC2007
# mkdir VOCdevkit2012
# cd VOCdevkit2012
# ln -s $VOCdevit/VOC2012 VOC2012
```
### Download pretrained network
cd yolov2.pytorch
cd data
mkdir pretrained
cd pretrained
wget https://pjreddie.com/media/files/darknet19_448.weights
### Train the model
python train.py --cuda true
If you want use multiple GPUs to accelerate the training. you can use the command below.
python train.py --cuda true --mGPUs true
**NOTE**: Multi-scale training uses more GPU memory. If you have only one GPU with 8G memory, it's better to set `multi-scale=False` in `config/config.py`. See [link](https://github.com/tztztztztz/yolov2.pytorch/blob/master/config/config.py#L31).
## Testing
python test.py --cuda true
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Yolov2 Pytorch 实现这个存储库旨在学习和理解 YOLO 算法。我是深度学习的初学者,我发现学习深度学习算法的最佳方法是从头开始实现它。所以如果你也有这种感觉,那就关注这个存储库吧!这个项目中的代码清晰易懂,我也尽可能地记录了它。 目的训练 Pascal VOC多 GPU 支持测试pascal voc 验证数据增强预训练网络重组层多尺度训练复现原始论文的mAP主要结果 训练集 测试集 地图@416 地图@544这个仓库 VOC2007+2012 VOC2007 72.7 74.6原文 VOC2007+2012 VOC2007 76.8 78.6运行时间GTX 1080 上约 19 毫秒 (52FPS)先决条件python 3.5.xpytorch 0.4.1tensorboardXopencv3枕头准备首先克隆代码git clone https://github.com/tztztztztz/yolov2.pytorch.git安装依赖项pip install -r requirements.txt
资源推荐
资源详情
资源评论
收起资源包目录
使用 pytorch 重新实现 YOLOv2 算法.zip (31个子文件)
loss.py 9KB
标签.txt 40B
LICENSE 1KB
yolo_eval.py 7KB
dataset
__init__.py 0B
pascal_voc.py 10KB
imdb.py 2KB
roidb.py 4KB
voc_eval.py 7KB
factory.py 966B
darknet.py 6KB
资源内容.txt 902B
requirements.txt 34B
.gitignore 1KB
images
image1.jpg 56KB
result3.png 418KB
result2.png 328KB
image2.jpg 93KB
result1.png 284KB
train.py 8KB
demo.py 3KB
test.py 5KB
util
__init__.py 0B
augmentation.py 5KB
network.py 3KB
arial.ttf 304KB
bbox.py 6KB
visualize.py 6KB
README.md 3KB
config
config.py 946B
yolov2.py 5KB
共 31 条
- 1
资源评论
徐浪老师
- 粉丝: 8103
- 资源: 8096
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于深度学习的所有权分心驾驶(行为疲劳+行为危险)预警系统采用YOLOv5+Deepsort实现所有权的危险驾驶行为的预警监测.zip
- 411jsp心理健康测试咨询网站毕业课程源码设计+论文资料
- 基于yolo的csgo AI.zip
- 基于javaWeb实现学生选课管理系统源码+数据库文件+文档说明
- 安卓逆向分析工具集合:包含baksmali-2.5.2.jar、classes-dex2jar.jar、jadx-gui-1.2.0-no-jre-win.exe
- 基于JavaWeb的大学生选课管理系统源码+数据库(毕业设计项目)
- 基于yolov7的姿势检测.zip
- java毕业设计-基于SSM的公租房维保系统【代码+论文+PPT】
- 基于yolov5识别算法实现的DNF自动脚本.zip
- 410asp电子政务网站设计毕业课程源码设计+论文资料+开题报告+答辩ppt资料全
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功