The origin py-faster-rcnn runs under Python2.7, now we want to run it under python3.6 CPU environment.
🔥 Faster-RCNN (Faster {R-CNN}: Towards Real-Time Object Detection with Region Proposal Networks) implemented (CPU) in Caffe 1.0 and Opencv3.2 . This is an unofficial implementation. 🔥
The code is in python 3.6 CPU under the following dependencies:
- caffe 1.0.0
- opencv 3.2.0
- python 3.6
- easydict 1.9
- h5py (2.10.0)
- leveldb (0.201)
- leveldb (0.201)
- python-dateutil (2.1)
- scikit-image (0.17.2)
NOTE If you are having issues compiling and you are using a recent version of CUDA/cuDNN, please consult this issue for a workaround
- Requirements for
Caffe
andpycaffe
(see: Caffe installation instructions)
Note: Caffe must be built with support for Python layers! U
# In your Makefile.config, make sure to have this line uncommented
WITH_PYTHON_LAYER := 1
# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1
You can download my [Makefile.config] in google drive (https://drive.google.com/file/d/1TC60laRbVU7ORep8oNM0zM8xE0flOQtn/view?usp=sharing) for reference.
2. Python packages you might not have: cython
, python-opencv
, easydict
3. [Optional] MATLAB is required for official PASCAL VOC evaluation only. The code now includes unofficial Python evaluation code.
- smaller networks (ZF) for CPU with at least 4G of memory suffices.
- Clone the Faster R-CNN repository
# Make sure to clone with --recursive
git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
-
We'll call the directory that you cloned Faster R-CNN into
FRCN_ROOT
Ignore notes 1 and 2 if you followed step 1 above.
Note 1: If you didn't clone Faster R-CNN with the
--recursive
flag, then you'll need to manually clone thecaffe-fast-rcnn
submodule:git submodule update --init --recursive
Note 2: The
caffe-fast-rcnn
submodule needs to be on thefaster-rcnn
branch (or equivalent detached state). This will happen automatically if you followed step 1 instructions. -
Build the Cython modules
cd $FRCN_ROOT/lib make
-
Build Caffe and pycaffe
cd $FRCN_ROOT/caffe-fast-rcnn # Now follow the Caffe installation instructions here: # http://caffe.berkeleyvision.org/installation.html # If you're experienced with Caffe and have all of the requirements installed # and your Makefile.config in place, then simply do: make -j8 && make pycaffe
Note :
-
For install opencv3, ref my blog
-
For install caffe-cpu, ref my blog
-
Download pre-computed Faster R-CNN detectors
cd $FRCN_ROOT ./data/scripts/fetch_faster_rcnn_models.sh
This will populate the
$FRCN_ROOT/data
folder withfaster_rcnn_models
. Seedata/README.md
for details. There will be two caffe pretrained model VGG16_faster_rcnn_final.caffemodel and ZF_faster_rcnn_final.caffemodel.
After successfully completing basic installation, you'll be ready to run the demo.
To run the demo, currently test on zf model.
cd $FRCN_ROOT
./demo.py --net zf --cpu
The demo performs detection using a ZF network.
- Caffe-CPU
- ZF
- Caffe-GPU
- Training on Image-Net
🍔