GitHub project address,
https://github.com/endernewton/tf-faster-rcnn
Tensorflow Faster RCNN for
Object Detection
.
Native environment:
- Mac: 10.13.4 no GPU
- python: 3.5
- tensorflow: 1.11.0
1 |
git clone https://github.com/endernewton/tf-faster-rcnn.git |
2. Modify the code for the CPU Only
① modified ./lib/setup.py
commented on 55,87,120-136 row cuda, GPU related code
②. / Lib / model / nms_wrapper.py
commented first row 12,20-21
3. Establish Cython module directory under ./lib
Clear a compiler generates executable file (.pyc, .so)
1 |
make clean |
If the compiler error successful. .So file will be generated, " pycache .pyc file under"
1 |
make |
Back to previous
1 |
cd .. |
4. Install Python COCO API at ./data
1 |
git clone https://github.com/pdollar/coco.git |
5. Download Data
setup VOC and COCO datasets (Part of COCO is done)
. 1 |
cd ./data |
After completing the above steps, data folder add two folders:
- VOCdevkit (contains folders VOCcode, VOC2007 and some other files)
- VOCdevkit2007 (soft link, when clicked, jump to ./data/VOCdevkit/)
6. Download the pre-training model
.sh file ./data/scripts/ under the URL can not access can be provided by the author Google Drive downloads.
Select voc_0712_80k-110k.tgz res101 is downloaded to ./data in.
7. Establish a pre-training model of soft link
1 |
NET=res101 |
It features 6 lines of code is:
① create folders = ./output/res101/voc_2007_trainval+voc_2012_trainval/ NewDir
$ ② in the new folder {NewDir} pre-training model / default download link, that ./data/voc_2007_trainval + voc_2012_trainval in 4 parameter files
this time, click ./output/vgg16/coco_2014_train+coco_2014_valminusminival/default can jump to ./data/coco_2014_train+coco_2014_valminusminival four parameters file
8. Run ./tools/demo.py
Under the picture ./data/demo to detect
the main subject and confidence probability get the picture: