Need help with RaspberryPi-FaceDetection-MTCNN-Caffe-With-Motion?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

206 Stars 63 Forks 19 Commits 7 Opened issues


MTCNN with Motion Detection, on Raspberry Pi with Love

Services available


Need anything else?

Contributors list

MTCNN with Motion Detection On Raspberry Pi 3

The Python version of MTCNN running on Raspberry Pi 3 with Love.
Also a motion detection trigger will help to improve the quality.


Installation of dependencies:

  sudo apt-get update && sudo apt-get upgrade
  sudo apt-get install -y gfortran cython
  sudo apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler git
  sudo apt-get install --no-install-recommends libboost-all-dev
  sudo apt-get install -y python-dev libgflags-dev libgoogle-glog-dev liblmdb-dev libatlas-base-dev python-skimage
  sudo pip install pyzmq jsonschema pillow numpy scipy ipython jupyter pyyaml

0. Raspbian 1. Caffe && PyCaffe:, My Blog

Install caffe:

  git clone
  cd caffe
  cp Makefile.config.example Makefile.config
  sudo nano Makefile.config
Modify next lines, instead of these
  #CPU_ONLY := 1
  INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
  LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib

  CPU_ONLY := 1
  INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
  LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/arm-linux-gnueabihf/hdf5/serial/
  make all
  make test
  make runtest
  make pycaffe

./scripts/ models/bvlc_googlenet sudo nano ~/.bashrc export PYTHONPATH=/home/pi/deepdream/caffe/python:$PYTHONPATH // Add at the end of file

Protobuf installation:

  cd ~/caffe
  cd python
  python build
  python google_test
  sudo python install
2. OpenCV && CV2: My Blog
If you have good luck,
sudo apt-get install opencv python-opencv
will have it done. or search installation guide from google.
  1. WebCam(D-Link DCS-932L)
    I have it on hand, so have to write a IPCamera class for it.
    You can simply use a Camera Model of PI (OV5647), it need Camera White Balance and parameter finetune. (PR Welcome)

 if you use PiNor Cam module or other nonUSB cam, you may need do following changes:

    sudo modprobe bcm2835-v4l2

code: ret, frame = , cnts, _ = cv2.findContours(thresh.copy(), cv2.RETREXTERNAL,cv2.CHAINAPPROXSIMPLE)

Tell mtcnn where pycaffe is

Edit mtcnn/, change caffe_path to your own.



We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.