Skip to content

Use a pi zero and pi camera as another layer in your presence detection for your smart home

Notifications You must be signed in to change notification settings

Splitter/face-recognition-to-mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Recognition to MQTT

This is not meant to be the only method of presence detection. It is built for and tested on a piZero with picamera but should work with any pi. Its simple in function, if a face it recognizes crosses through its view it fires off an mqtt message saying it detected the person by name. Then you handle the rest in your prefered home automation setup.

For anyone who has messed with presence detection methods in homebrew home automation setups most options are not always accurate/fast enough. Layering the various detection methods improves things greatly. This is just meant to be another layer in that stack.

Usage:

It consists of 3 files.

  • trainer.py - run this file and it will take pictures every 2 seconds(using the pi camera) to gather data for a user. And then encode that data for use in facial recognition
  • encoder.py - if you have your own set of images(must be jpg) for a person place the images in their own directory within the datastore directory. Name the directory after the person they represent(eg.. /datastore/fred/1.jpg). After that run this script and it will generate the vectors/encodings for the images for use later in facial recognition
  • recognizer.py - this is the main facial recogntion script. It will capture frames from the pi camera stream, check to see if it recognizes any faces in the frame and then fire off an mqtt message if it detects a known person(edit this file with your mqtt credentials)

Dependencies:

About

Use a pi zero and pi camera as another layer in your presence detection for your smart home

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages