Ubuntu run through PY-FASTER-RCNN, detailed demo operation Flow

Source: Internet
Author: User

On different servers on different machines have done many experiments, respectively encountered different errors and run through the PY-FASTER-RCNN, so, here do a summary of the process:

First, download the file:

First, a file can be downloaded in two ways:

1, need to download the path on the official website: https://github.com/rbgirshick/py-faster-rcnn

After the download of the method folder: py-faster-rcnn/caffe-fast-rcnn/may be blank: this time you need to continue to download the command line

CD CAFFE-FAST-RCNN
git submodule update--init--recursive

2, in Ubuntu directly under the command line download: (personally recommend this method: more stable)

git clone--recursive https://github.com/rbgirshick/py-faster-rcnn.git

Second, compile Caffe:

1. After the download is complete, we enter the Py-faster-rcnn//lib file to compile:

$FRCN _root/libmake

2. Under the py-faster-rcnn/caffe-fast-rcnn/file path, download the Makefile.config file:

Link URL: https://dl.dropboxusercontent.com/s/6joa55k64xo2h68/Makefile.config?dl=0

3, change the inside two parameters: (do not change the words behind the compilation can be carried out, but run to the back of the demo will find a lot of header files are not included in, such as)

So it's very necessary to change the following two parameters:

# in your makefile.config, make sure to has this line uncommentedwith_python_layer: = 1# unrelatedly, it ' s also r ecommendedthat CUDNN use_cudnn: = 1  

4, compile Caffe:

$FRCN _ROOT/CAFFE-FAST-RCNN

Make-j64

Errors may occur, as follows:

Workaround: Enter your own root directory under the original Caffe and copy the corresponding file into the CAFFE-FAST-RCNN

1. Replace the./include/caffe/util/cudnn.hpp with the CUDNN implementation in the latest version of Caffe, which is the corresponding cudnn.hpp.

2. In the./include/caffe/layers, all files beginning with cudnn, such as CUDNN_CONV_LAYER.HPP. replaced with the corresponding file of the same name in the latest version of Caffe.

3. In the./src/caffe/layer, all files beginning with cudnn, such as CUDNN_LRN_LAYER.CU,CUDNN_POOLING_LAYER.CPP,CUDNN_SIGMOID_LAYER.CU.

replaced with the corresponding file of the same name in the latest version of Caffe. As shown in the following:

Continue to work above:

Compile successfully! Continue with the previous command line compilation:

Make Pycaffe

Compile correctly: Continue with the following steps;

Third, download the model of training good:

1. Command line download:

$FRCN _root./data/scripts/fetch_faster_rcnn_models.sh

2, from imagenet training to Caffe models (ZF, VGG16) pre-trained Model Download command (under the scripts file contains the downloaded script, if you encounter an error must be the FQ problem on the server)

./data/scripts/fetch_imagenet_models.sh

3. Faster R-CNN models trained model download command from VOC 2007 Training (IBID.)

./data/scripts/fetch_faster_rcnn_models.sh

4, set up the above download, our./data directory will appear under the required model:

Four, run through the demo.py file:

The above has been compiled Caffe and downloaded well trained model Why should the data: we can now start running Demo:

$FRCN _root./tools/demo.py

After running, we can see the target frame of the picture we predicted:

Five, we are not limited to running through demo.py, we need to understand the demo.py file inside the principle:

First of all, we will cut the demo.py file inside the function block: nothing but: def vis_detections (), Def demo (), Def Parse_args ()

Let's take a look at a functional resolution diagram:

We can see: the mainstream of the demo.py file is the yellow arrow, Def vis_detections () is the purple Arrow, Def demo () is a light blue arrow, Def Parse_args () is a red-brown arrow.

As the arrows extend, we get to know more and more about the function transformation inside: Where: Scores represents the score, boxes represents the target box diagonal two points four coordinate values, Dets represents the matrix of the various box coordinates and fractions, inds the corresponding subscript of the window that exceeds the threshold to meet the requirements.

Six, the specific code content explanation:

Po out some detailed explanations of the manuscript:

Ubuntu run through PY-FASTER-RCNN, detailed demo operation Flow

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.