Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Faster RCNN with PyTorch

License

NotificationsYou must be signed in to change notification settings

longcw/faster_rcnn_pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note: I re-implemented faster rcnn in this project when I started learning PyTorch. Then I use PyTorch in all of my projects. I still remember it costed one week for me to figure out how to build cuda code as a pytorch layer :).But actually this is not a good implementation and I didn't achieve the same mAP as the original caffe code.

This project is no longer maintained and may not compatible with the newest pytorch (after 0.4.0). So I suggest:

  • You can still read and study this code if you want to re-implement faster rcnn by yourself;
  • You can use the better PyTorch implementation byruotianluoorDetectron.pytorch if you want to train faster rcnn with your own data;

This is aPyTorchimplementation of Faster RCNN.This project is mainly based onpy-faster-rcnnandTFFRCNN.

For details about R-CNN please refer to thepaperFaster R-CNN: Towards Real-Time Object Detection with Region Proposal Networksby Shaoqing Ren, Kaiming He, Ross Girshick, Jian Sun.

Progress

  • Forward for detecting
  • RoI Pooling layer with C extensions on CPU (only forward)
  • RoI Pooling layer on GPU (forward and backward)
  • Training on VOC2007
  • TensroBoard support
  • Evaluation

Installation and demo

  1. Install the requirements (you can use pip orAnaconda):

    conda install pip pyyaml sympy h5py cython numpy scipyconda install -c menpo opencv3pip install easydict
  2. Clone the Faster R-CNN repository

    git clone git@github.com:longcw/faster_rcnn_pytorch.git
  3. Build the Cython modules for nms and the roi_pooling layer

    cd faster_rcnn_pytorch/faster_rcnn./make.sh
  4. Download the trained modelVGGnet_fast_rcnn_iter_70000.h5 (updated)and set the model path indemo.py

  5. Run demopython demo.py

Training on Pascal VOC 2007

Followthis project (TFFRCNN)to download and prepare the training, validation, test dataand the VGG16 model pre-trained on ImageNet.

Since the program loading the data infaster_rcnn_pytorch/data by default,you can set the data path as following.

cd faster_rcnn_pytorchmkdir datacd dataln -s$VOCdevkit VOCdevkit2007

Then you can set some hyper-parameters intrain.py and training parameters in the.yml file.

Now I got a 0.661 mAP on VOC07 while the origin paper got a 0.699 mAP.You may need to tune the loss function defined infaster_rcnn/faster_rcnn.py by yourself.

Training with TensorBoard

With the aid ofCrayon,we can access the visualisation power of TensorBoard for anydeep learning framework.

To use the TensorBoard, install Crayon (https://github.com/torrvision/crayon)and setuse_tensorboard = True infaster_rcnn/train.py.

Evaluation

Set the path of the trained model intest.py.

cd faster_rcnn_pytorchmkdir outputpython test.py

License: MIT license (MIT)

About

Faster RCNN with PyTorch

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp