This repository contains an adjusted version of fast-rcnn for our hospital-people-detector. The original repository is created by Ross Girshick at Microsoft Research, Redmond and can be found here.
Please consult the original repo's README for information on using fast r-cnn in general. Here, we describe how to get our version running for the hospital-people-detector.
1.1 Install the necessary requirements for Caffe
and pycaffe
(see: Caffe installation instructions)
1.2 Get the caffe code: Alternative 1:
You can get the original caffe from the BVLC caffe repository.
git clone https://github.com/BVLC/caffe.git
You will need to apply the pull request BVLC/caffe#4163 to make caffe compatible with fast r-cnns special layers:
cd caffe
git pull origin pull/4163/head
1.2 Get the caffe code: Alternative 2:
You can also use our caffe fork which includes the above mentioned pull request and is intended to work with fast-rcnn-mobility-aids:
git clone https://github.com/marinaKollmitz/caffe.git
1.3 Compile caffe
cd caffe
cp Makefile.config.example Makefile.config
Adjust the Makefile.config to your needs. Make sure to uncomment the support for python layers:
# In your Makefile.config, make sure to have this line uncommented
WITH_PYTHON_LAYER := 1
Compile caffe and pycaffe
make -j8 && make pycaffe
Consult the caffe installation instructions for more information about compiling caffe.
2.1 clone our Fast R-CNN repository
git clone https://github.com/marinaKollmitz/fast-rcnn-mobility-aids.git
2.2 Build the Cython modules
cd fast-scnn-mobility-aids/lib
make
Add caffe and fast-rcnn-mobility-aids to your paths:
gedit ~/.bashrc
Add the following lines (replace <path-to-caffe>
and <path-to-fast-rcnn-mobility-aids>
with your paths):
#Caffe
export PYTHONPATH=<path-to-caffe>/python:$PYTHONPATH
export PATH=<path-to-caffe>/distribute:$PATH
#Fast R-CNN
export PYTHONPATH=<path-to-fast-rcnn-mobility-aids>/lib:$PYTHONPATH
Confirm both modules are found:
python
>>> import caffe
>>> import fast_rcnn
Both lines should return without error.