**
Fast-rcnn python demo
**
本章是githup上的py-faster-renn的实现
假设:已经安装好caffe,并且python 接口可用(本文的实验环境:ubuntu14.04 ,python2.5 cudnn 8.0)。
同时你也可以通过阅读README.md,按照上面的要求按照demo所需的依赖。
-确保安装好python的一些必要的module, 如:cython, python-opencv,easydict
- 下载demo假设所下载的py-faster-rcnn.git在目录/home/guest/下,用 FRCNROOT代替/home/guest/,以下都使用 FRCN_ROOT
$ git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
2.编译 Cython
cd $FRCN_ROOT/lib
make
3.修改Makefile.config.example.
cd $FRCN_ROOT/caffe-fast-rcnn
mv Makefile.config.example Makefile.config
同时修改Makefile.config 中的内容:
#把 WITH_PYTHON_LAYER := 1 前面的“#“去掉
WITH_PYTHON_LAYER := 1
4.在caffe-fast_rcnn 中编译
cd $FRCN_ROOT/caffe-fast-rcnn
make -j8 && make pycaffe
如果没有报错,进行下一步
5.下载检测文件
cd $FRCN_ROOT
./data/scripts/fetch_faster_rcnn_models.sh
假如没错,下一步
6.运行demo
cd $FRCN_ROOT
./tools/demo.py
也可以用以下命令运行
#指定使用gpu
python ./tools/demo.py --gpu 0