Giter VIP home page Giter VIP logo

new-yolov1_pytorch's Introduction

new-YOLOv1_PyTorch

In this project, you can enjoy:

  • a new version of yolov1

Network

This is a a new version of YOLOv1 built by PyTorch:

  • Backbone: resnet18
  • Head: SPP, SAM

Train

  • Batchsize: 32
  • Base lr: 1e-3
  • Max epoch: 160
  • LRstep: 60, 90
  • optimizer: SGD

Before I tell you how to use this project, I must say one important thing about difference between origin yolo-v2 and mine:

  • For data augmentation, I copy the augmentation codes from the https://github.com/amdegroot/ssd.pytorch which is a superb project reproducing the SSD. If anyone is interested in SSD, just clone it to learn !(Don't forget to star it !)

So I don't write data augmentation by myself. I'm a little lazy~~

My loss function and groundtruth creator both in the tools.py, and you can try to change any parameters to improve the model.

Experiment

Environment:

  • Python3.6, opencv-python, PyTorch1.1.0, CUDA10.0,cudnn7.5
  • For training: Intel i9-9940k, TITAN-RTX-24g
  • For inference: Intel i5-6300H, GTX-1060-3g

VOC:

size mAP FPS
VOC07 test 320 64.4 -
VOC07 test 416 68.5 -
VOC07 test 608 71.5 -

COCO:

size AP AP50
COCO val 320 14.50 30.15
COCO val 416 17.34 35.28
COCO val 608 19.90 39.27

Installation

  • Pytorch-gpu 1.1.0/1.2.0/1.3.0
  • Tensorboard 1.14.
  • opencv-python, python3.6/3.7

Dataset

As for now, I only train and test on PASCAL VOC2007 and 2012.

VOC Dataset

I copy the download files from the following excellent project: https://github.com/amdegroot/ssd.pytorch

I have uploaded the VOC2007 and VOC2012 to BaiDuYunDisk, so for researchers in China, you can download them from BaiDuYunDisk:

Link:https://pan.baidu.com/s/1tYPGCYGyC0wjpC97H-zzMQ

Password:4la9

You will get a VOCdevkit.zip, then what you need to do is just to unzip it and put it into data/. After that, the whole path to VOC dataset is:

  • data/VOCdevkit/VOC2007
  • data/VOCdevkit/VOC2012.

Download VOC2007 trainval & test

# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/VOC2007.sh # <directory>

Download VOC2012 trainval

# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/VOC2012.sh # <directory>

MSCOCO Dataset

I copy the download files from the following excellent project: https://github.com/DeNA/PyTorch_YOLOv3

Download MSCOCO 2017 dataset

Just run sh data/scripts/COCO2017.sh. You will get COCO train2017, val2017, test2017:

  • data/COCO/annotations/
  • data/COCO/train2017/
  • data/COCO/val2017/
  • data/COCO/test2017/

Train

VOC

python train.py -d voc --cuda -v [select a model] -ms

You can run python train.py -h to check all optional argument.

COCO

python train.py -d coco --cuda -v [select a model] -ms

Test

VOC

python test.py -d voc --cuda -v [select a model] --trained_model [ Please input the path to model dir. ]

COCO

python test.py -d coco-val --cuda -v [select a model] --trained_model [ Please input the path to model dir. ]

Evaluation

VOC

python eval.py -d voc --cuda -v [select a model] --train_model [ Please input the path to model dir. ]

COCO

To run on COCO_val:

python eval.py -d coco-val --cuda -v [select a model] --train_model [ Please input the path to model dir. ]

To run on COCO_test-dev(You must be sure that you have downloaded test2017):

python eval.py -d coco-test --cuda -v [select a model] --train_model [ Please input the path to model dir. ]

You will get a .json file which can be evaluated on COCO test server.

new-yolov1_pytorch's People

Contributors

yjh0410 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

new-yolov1_pytorch's Issues

SAM模块问题

我看了一下原版的论文, 加了CBAM 后代码很多人train效果还不如原版的resnet50。
请问一下作者有没有去掉SAM模块试过呢?效果如何?

Why we should use normalize to the image?

Hi! Thanks for awesome work!
Recently, I am trying to design a new object detection network based on yolov1, my work is based on another work https://github.com/abeardear/pytorch-YOLO-v1/blob/master/train.py . I have tested that my work can overfit in Pascal VOC 2007+2012 trainval. But my work suffered heavy overfit . I have tried dropout weight decay and data augment . But the problem is still not solved. And I noticed your work , I find that you will do a normalize to image which is other work doesn't have . Why you do it? Is is have an advantage in overcoming overfit?
Looking forward to your reply!

类别输出未经过softmax层

    作者大大你好,感谢你提供的代码,对我帮助很大!
    我最近在做三维的目标检测,在修改代码之后发现类别部分的损失出现负数,搜索之后发现这是因为交叉熵损失的输入大于1,而经过检查也确实发现在网络的训练阶段,类别输出好像没有经过softmax层,这样是对的吗?

File was loaded in the wrong encoding: 'UTF-8'

The file generated in the folder : "voc_eval" is not available , and the error is File was loaded in the wrong encoding : 'UTF-8' , I've tried every encoding ,but the problem still exist
how can I solve this problem?
thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.