1 首先要保证安装了cython, python-opencv, easydict,如果没有请执行以下命令:
pip install cython
pip install easydict
apt-get install python-opencv
或:
sudo apt-get install cython
sudo apt-get install python-opencv
sudo pip install easydict
2 下载Faster R-CNN源码:
git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
加--recursive参数,能保证项目工程中的caffe-fast-rcnn子模块的下载
3 修改Makefile.config
cp Makeile.config.example Makefile.config
修改:
(1)WITH_PYTHON_LAYER:=1 (打开python接口)
(2)修改以下两行成下列模样:
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial/
4 编译Cython模块:
cd py-faster-rcnn/lib
make