Giter Club home page Giter Club logo

py-faster-rcnn's Introduction

The Original README.md is moved to README_original.md


Tutorial: http://www.cnblogs.com/zhiyishou/p/5651321.html [In Chinese]

##Train ImageNet dataset on faster-rcnn

First, we could download the image files by classes with bounding boxes, so we simply use these data to train our own classifier.

Untar the images and bounding boxes annotations we downloaded from imagenet by [wnid] to above tree:

|---data
  |---imagenet
    |---Annotations
    |---Images

In fact the annotation xml files will less than image files, so we need to use existed annotations to and its corresponded image to train the classifier.

base on the upstream, this project add imagenet dataset get function in to dataset.factory, and the drawing box for checking whether the boxes at right place in image.

To draw the bounding boxes on image to new images, run:

./lib/datasets/imagenet/draw.py

###Train

To train on this dataset, you need to prepare the next steps:

  1. change the classes in ./lib/datasets/imagenet/imagenet.py
  2. change the classes num in pt file under ./model/imagenet/{NET}
  3. fetch pretrained models by run ./data/scripts/fetch_imagenet_models.sh(optional)

if your wanna train 'car,dog' classes, so the num will be 3 because of '__background__',change the value in above layers in each files

input-data->num_classes = num
class_score->num_output = num
bbox_pred->num_output   = num*4

These prototxt was copied from pascal_voc path, so you could copy the prototxt file you need from pascal_voc path for using

then just need to run:

./tools/train_faster_rcnn_alt_opt.py --gpu 0 \
--net_name ZF \
--weights data/imagenet_models/ZF.v2.caffemodel[optional] \
--imdb imagenet \
--cfg experiments/cfgs/faster_rcnn_alt_opt.yml \
--pt_type imagenet

In this script, only pt_type is new, the use of others arguments you could see in the demo ./experiments/scripts/faster_rcnn_alt_opt.sh. pt_type accept pascal_voc,imagenet to set the prototxt which will be used.

###Classifier

Change the classes in ./tools/classify.py then run:

./tools/classify.py --net zf

so we could get the object detected image like deom.py works.

Have fun

py-faster-rcnn's People

Contributors

rbgirshick avatar zhiyishou avatar dectinc avatar drozdvadym avatar wangdelp avatar

Watchers

James Cloos avatar

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.