GithubHelp home page GithubHelp logo

treb1en / lighthead-rcnn-in-pytorch0.4.1 Goto Github PK

View Code? Open in Web Editor NEW
51.0 5.0 8.0 4.72 MB

Pytorch0.4.1 codes for Lighthead-RCNN

License: MIT License

Python 57.35% Shell 1.15% Cuda 16.84% C 7.66% C++ 1.14% Jupyter Notebook 15.82% Makefile 0.04%

lighthead-rcnn-in-pytorch0.4.1's Introduction

Lighthead - RCNN

Implementation of Lighthead-RCNN in Pytorch 0.4.1 codes

Contributions

  • The first reimplementation of Lighthead-RCNN in full stable Pytorch codes
  • A new implementation of CUDA codes of Position Sensitive ROI Pooling is provided, in case all previous ones don't work under the Pytorch version >= 0.4
  • Pretrained model is provided

  • At the time being, this repo only support single batch training.
  • Dataloader from chainercv is used in training

Pretrained model and Performance

res101_lighthead_rcnn@ Google drive

Implementation [email protected]:0.95/all [email protected]/all [email protected]/all mAP:0.5:0.95/small mAP:0.5:0.95/medium mAP:0.5:0.95/large
Original 0.400 0.621 0.429 0.225 0.446 0.540
Ours 0.3963 0.601 0.432 0.217 0.447 0.539
map/iou=0.50:0.95/area=all/max_dets=100: 0.396344
map/iou=0.50/area=all/max_dets=100: 0.601353
map/iou=0.75/area=all/max_dets=100: 0.432155
map/iou=0.50:0.95/area=small/max_dets=100: 0.217397
map/iou=0.50:0.95/area=medium/max_dets=100: 0.447772
map/iou=0.50:0.95/area=large/max_dets=100: 0.538968
mar/iou=0.50:0.95/area=all/max_dets=1: 0.319597
mar/iou=0.50:0.95/area=all/max_dets=10: 0.496089
mar/iou=0.50:0.95/area=all/max_dets=100: 0.513308
mar/iou=0.50:0.95/area=small/max_dets=100: 0.296478
mar/iou=0.50:0.95/area=medium/max_dets=100: 0.578120
mar/iou=0.50:0.95/area=large/max_dets=100: 0.692352

I have only trained it with 18 epochs instead of 30 epochs in the original paper due to it took too long time on my single 1080TI card system.

How to use

Preparation

  1. Clone the this repository.

    git clone https://github.com/TreB1eN/Lighthead-RCNN-in-Pytorch0.4.1.git
    cd Lighthead-RCNN-in-Pytorch0.4.1/
  2. Prepare COCO dataset.

    It is recommended to symlink the dataset root to $Lighthead-RCNN-Pytorch/data.

  3. Create following folders and download the pretrained model to work_space/final

Lighthead-RCNN-Pytorch
├── functions
├── models
├── utils
├── data
│   ├── coco2014
│   │   ├── annotations
│   │   ├── train2014
│   │   ├── val2014
├── work_space
│   ├── model
│   ├── log
│   ├── final
│   ├── save

Installation

  1. Install PyTorch 0.4.1 and torchvision following the official instructions.

  2. Install dependencies

    pip install -r requirements.txt
  3. Compile cuda extensions.

    ./compile.sh  # or "PYTHON=python3 ./compile.sh" if you use system python3 without virtual environments

Inference

python detect.py -f data/person.jpg -o data/person_detected.jpg

Evaluate

python eval.py

Train

  1. Download the pretrained backbone Res101 model to models folder

  2. python train.py 
  3. More detailed configuration is in utils/config.py

References

chainer-light-head-rcnn

light_head_rcnn

paper

Demos


Contact

Email : [email protected]

Questions and PRs are welcome

lighthead-rcnn-in-pytorch0.4.1's People

Contributors

treb1en 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

Watchers

 avatar  avatar  avatar  avatar  avatar

lighthead-rcnn-in-pytorch0.4.1's Issues

fps?

Have you test the fps in your computer?
when I run the eval.py, it is only 2.17samples/sec, this is too slow for light head? is it?

roi generates from RPN unnormal

Hi, did you train your code successfully? the rois genreates from RPN are not right at all:

roi origin:  [[933.   0. 933. 700.]
 [933.   0. 933.   0.]
 [933.   0. 933. 700.]
 [933.   0. 933.   0.]
 [  0.   0. 933.   0.]
 [  0. 700.   0. 700.]
 [  0.   0. 933.   0.]
 [  0. 700. 933. 700.]]


it has a lot zero coordinates, and the w, h calculated were also zeros mostly:

[  0. 933.   0. ... 933.   0.   0.]
[700. 700. 700. ...   0.   0. 700.]

What may caused this error?

在resnet101的最后一个block的feature size和膨胀卷积问题

非常好的代码
我看了作者的tensorflow代码,问一个问题,是不是您这也是在标准的resnet101上修改的
普通的resnet的block4的feature size,也就是stage2的feature size应该是block3(rpn feature size)的二分之一,比如说提取rpn feature的size是50x75,那么最后进入那个head的应该是25x38,但是这里貌似最后的size还是50x75,block4和block3是一样的size,并且还用了2次膨胀卷积,这里的预训练参数是您完全按照这个网络结构重新在imagenet 上重新训练的呢,还是直接用标准的resnet的预训练参数?

Training is Too Slow

Hi @TreB1eN,

While training on COCO with my RTX 2080 Super GPU, it is taking around 20 hours per epoch which is to slow. I mean to run 30 epochs, I need to wait for around 25 days?

How can the training be accelerated? Thanks

Python version?

Hi, I am trying to use this package to run light head rcnn. However, setting it up via the requirements.txt is unsuccessful so far. Would like to know which python version you used. It seems to be working for python 2.7 when I need to install the models package 0.7.0. However, it doesn't work for pytorch 0.4.1. Any suggestions? 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.