# YOLOV3
---
# Introduction
This is my own YOLOV3 written in pytorch, and is also the first time i have reproduced a object detection model.The dataset used is PASCAL VOC. The eval tool is the voc2010. Now the mAP gains the goal score.
Subsequently, i will continue to update the code to make it more concise , and add the new and efficient tricks.
`Note` : Now this repository supports the model compression in the new branch [model_compression](https://github.com/Peterisfar/YOLOV3/tree/model_compression)
---
## Results
| name | Train Dataset | Val Dataset | mAP(others) | mAP(mine) | notes |
| :----- | :----- | :------ | :----- | :-----| :-----|
| YOLOV3-448-544 | 2007trainval + 2012trainval | 2007test | 0.769 | 0.768 \| - | baseline(augument + step lr) |
| YOLOV3-\*-544 | 2007trainval + 2012trainval | 2007test | 0.793 | 0.803 \| - | \+multi-scale training |
| YOLOV3-\*-544 | 2007trainval + 2012trainval | 2007test | 0.806 | 0.811 \| - | \+focal loss(note the conf_loss in the start is lower) |
| YOLOV3-\*-544 | 2007trainval + 2012trainval | 2007test | 0.808 | 0.813 \| - | \+giou loss |
| YOLOV3-\*-544 | 2007trainval + 2012trainval | 2007test | 0.812 | 0.821 \| - | \+label smooth |
| YOLOV3-\*-544 | 2007trainval + 2012trainval | 2007test | 0.822 | 0.826 \| - | \+mixup |
| YOLOV3-\*-544 | 2007trainval + 2012trainval | 2007test | 0.833 | 0.832 \| 0.840 | \+cosine lr |
| YOLOV3-\*-* | 2007trainval + 2012trainval | 2007test | 0.858 | 0.858 \| 0.860 | \+multi-scale test and flip, nms threshold is 0.45 |
`Note` :
* YOLOV3-448-544 means train image size is 448 and test image size is 544. `"*"` means the multi-scale.
* mAP(mine)'s format is (use_difficult mAP | no_difficult mAP).
* In the test, the nms threshold is 0.5(except the last one) and the conf_score is 0.01.`others` nms threshold is 0.45(0.45 will increase the mAP)
* Now only support the single gpu to train and test.
---
## Environment
* Nvida GeForce RTX 2080 Ti
* CUDA10.0
* CUDNN7.0
* ubuntu 16.04
* python 3.5
```bash
# install packages
pip3 install -r requirements.txt --user
```
---
## Brief
* [x] Data Augment (RandomHorizontalFlip, RandomCrop, RandomAffine, Resize)
* [x] Step lr Schedule
* [x] Multi-scale Training (320 to 640)
* [x] focal loss
* [x] GIOU
* [x] Label smooth
* [x] Mixup
* [x] cosine lr
* [x] Multi-scale Test and Flip
---
## Prepared work
### 1、Git clone YOLOV3 repository
```Bash
git clone https://github.com/Peterisfar/YOLOV3.git
```
update the `"PROJECT_PATH"` in the params.py.
### 2、Download dataset
* Download Pascal VOC dataset : [VOC 2012_trainval](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar) 、[VOC 2007_trainval](http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar)、[VOC2007_test](http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar). put them in the dir, and update the `"DATA_PATH"` in the params.py.
* Convert data format : Convert the pascal voc *.xml format to custom format (Image_path0 xmin0,ymin0,xmax0,ymax0,class0 xmin1,ymin1...)
```bash
cd YOLOV3 && mkdir data
cd utils
python3 voc.py # get train_annotation.txt and test_annotation.txt in data/
```
### 3、Download weight file
* Darknet pre-trained weight : [darknet53-448.weights](https://pjreddie.com/media/files/darknet53_448.weights)
* This repository test weight : [best.pt](https://pan.baidu.com/s/1MdE2zfIND9NYd9mWytMX8g)
Make dir `weight/` in the YOLOV3 and put the weight file in.
---
## Train
Run the following command to start training and see the details in the `config/yolov3_config_voc.py`
```Bash
WEIGHT_PATH=weight/darknet53_448.weights
CUDA_VISIBLE_DEVICES=0 nohup python3 -u train.py --weight_path $WEIGHT_PATH --gpu_id 0 > nohup.log 2>&1 &
```
`Notes:`
* Training steps could run the `"cat nohup.log"` to print the log.
* It supports to resume training adding `--resume`, it will load `last.pt` automaticly.
---
## Test
You should define your weight file path `WEIGHT_FILE` and test data's path `DATA_TEST`
```Bash
WEIGHT_PATH=weight/best.pt
DATA_TEST=./data/test # your own images
CUDA_VISIBLE_DEVICES=0 python3 test.py --weight_path $WEIGHT_PATH --gpu_id 0 --visiual $DATA_TEST --eval
```
The images can be seen in the `data/`
---
## TODO
* [ ] Mish
* [ ] OctConv
* [ ] Custom data
---
## Reference
* tensorflow : https://github.com/Stinky-Tofu/Stronger-yolo
* pytorch : https://github.com/ultralytics/yolov3
* keras : https://github.com/qqwweee/keras-yolo3
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
YOLOV3介绍这是我自己用pytorch写的YOLOV3,也是第一次复现物体检测模型,使用的数据集是PASCAL VOC,评估工具是voc2010,现在mAP已经达到了目标分数。后续我会不断更新代码,使其更加简洁,并添加新的、高效的技巧。Note现在此存储库在新分支model_compression中支持模型压缩结果姓名 训练数据集 瓦尔数据集 mAP(其他) mAP(我的) 笔记约洛夫3-448-544 2007 列车时刻表 + 2012 列车时刻表 2007测试 0.769 0.768 | - 基线(增强 + 步骤 lr)YOLOV3-*-544 2007 列车时刻表 + 2012 列车时刻表 2007测试 0.793 0.803 | - +多尺度训练YOLOV3-*-544 2007 列车时刻表 + 2012 列车时刻表 2007测试 0.806 0.811 | - +focal loss(注意开始时的conf_loss较低)YOLOV3-*-544 2007 列车时刻表 + 2012 列车时刻表 2007测试 0.808 0.813 | - +gi
资源推荐
资源详情
资源评论
收起资源包目录
pytorch 的 yolov3.zip (36个子文件)
__init__.py 0B
标签.txt 62B
LICENSE 1KB
utils
data_augment.py 5KB
__init__.py 83B
gpu.py 898B
cosine_lr_scheduler.py 2KB
voc.py 3KB
datasets.py 9KB
tools.py 13KB
visualize.py 16KB
资源内容.txt 898B
nohup.log 6.16MB
model
__init__.py 0B
loss
__init__.py 0B
yolo_loss.py 6KB
layers
__init__.py 0B
blocks_module.py 732B
activate.py 415B
conv_module.py 1KB
necks
__init__.py 0B
yolo_fpn.py 6KB
head
__init__.py 0B
yolo_head.py 2KB
yolov3.py 6KB
backbones
__init__.py 0B
darknet53.py 5KB
requirements.txt 124B
eval
evaluator.py 7KB
voc_eval.py 7KB
.gitignore 89B
train.py 7KB
test.py 3KB
README.md 4KB
config
__init__.py 0B
yolov3_config_voc.py 1KB
共 36 条
- 1
资源评论
徐浪老师
- 粉丝: 8203
- 资源: 9366
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 技术资料分享UCOSII 2.90 ReleaseNotes很好的技术资料.zip
- 技术资料分享Ucos-II-中文注释版很好的技术资料.zip
- 技术资料分享uCGUI的性能与资源占用很好的技术资料.zip
- 技术资料分享uCGUI 简介很好的技术资料.zip
- LPC1768微控制器手册-全面解析硬件功能及应用场景
- spring-boot-starter-2.3.5.RELEASE.jar
- 【java毕业设计】粮食仓库管理系统源码(springboot+前端+mysql+说明文档+LW).zip
- 支付宝小程序小程序端的F2图表演示.zip
- Balluff BNI XG3-508-0C5-R015 ECS V1.0.6.xml
- 【java毕业设计】计算机类考研交流平台源码(springboot+前端+mysql+说明文档+LW).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功