8000 GitHub - ttchin/FaceDetected: A project based on tensor flow running on raspberry that can detect face.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ttchin/FaceDetected

Repository files navigation

FaceDetected

A project based on tensor flow running on Raspberry that can detect face.

Requirements

  1. Raspberrypi 3
  2. Camera
  3. Speaker
  4. Python 3.5 on Windows/MacOs, Python 3.4 on Raspberry
  5. Lots of images of the target and others
  6. Put the images into data/target and others

Prepare environments

In windows and macos, opencv only works on python 3.5

  1. conda create -n 3.5.2 python=3.5.2
  2. source activate 3.5.2 for Linux/MacOS or activate 3.5.2 for Windows
  3. conda install -c https://conda.anaconda.org/menpo opencv3
  4. conda install h5py
  5. conda install scipy
  6. pip install keras
  7. pip install sklearn
  8. pip install pygame
  9. pip install tensorflow

In raspberry, opencv only works on python 3.4

  1. For opencv:http://www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3/

  2. For tensorflow:https://github.com/samjabrahams/tensorflow-on-raspberry-pi

  3. For keras:https://github.com/bitschift/brew.ai/wiki/Setting-up-the-Pi

  4. If you got an error like Error (-215) size.width>0 && size.height>0 occurred when attempting to display an image using OpenCV, you can access the camera board on /dev/video0 by running the command: sudo modprobe bcm2835-v4l2 This will have to be run on every boot of the device. Or you can put modprobe bcm2835-v4l2 in /etc/rc.local to make it run on every boot automatically.

Prepare images

  • Run python3.4 in raspberry.

Capture pictures and crop faces from the camera video stream

  • e.g. python CapturePictures.py -n 50
  • python CapturePictures.py -h will give you more information.

Or crop faces from the existing pictures

  • e.g. python CropFaces.py -d ./captured_pictures/
  • python CropFaces.py -h will give you more information.

Train models

  1. Put the croppe 6202 d face images of each person into different directories under "/train/", like "/train/Tony", "/train/Chao", "/train/Leo". Please note the folder name will be used as the person's name.
  2. python FaceTrain.py will generate a single model from all the given pictures into "./model".

Start face detection

  • When the model is ready, python DetectFaces.py will capture faces from the camera video stream and identify who it is.
  • python DetectFaces.py -h will give you more information.

About

A project based on tensor flow running on raspberry that can detect face.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages

0