Get texts from a smart computer that notifies you who is at your door
Here's the gist:
- A Raspberry Pi with a camera could be attached to the front of a door, the peephole on the back of the door, or maybe even inside something placed on your doorstep.
- The Pi would attempt to scan the faces of those coming up to your door, and will notify you via text who's there.
- We will need to train a facial-recognition model with pictures of people we'd like to recognize.
- This could be done at time of setup, with pictures of roommates and family members, or we could attempt to train iteratively with photos taken from the Pi.
- Hardware constraints may prevent us from training on-device. Due to scope of project we probably should avoid implementing offloading the training to another device.
- Send output from facial-recognition model to user via text-message using the Twilio Python library
Linux
TODO
macOS
// face detection uses dlib
// when we install dlib through `pip install -r requirements` we will need to have cmake on our path.
brew install cmake
git clone https://github.com/diddlypop/whodat.git
cd whodat
// download python3.7.6 or use pyenv (not available in pip / will need to compile from source)
// to change global python version to python3.7.6
// activate virtualenv or use pipenv (`pip install pipenv` outside of virtual environment)
pip install -r requirements.txt
Windows
TODO
https://cmake.org/download/
Encodings
// place directories inside profiles/ that are named after the person you are looking to encode for
// place all photos of that person in their named directory
cd assets
mkdir profiles/
// place photos inside profiles
python encode_faces.py --dataset profiles/ --encodings encodings.pickle --detection-method hog
python pi_face_recognition.py -c haarcascade_frontalface_default.xml -e encodings.pickle
Flask
// to run flask test server run the WebApp/main.py
python main.py
// direct browser to 127.0.0.1:5000/
Testing
// call pytest to run test suite
pytest
- twilio
- Don't forget that you should never commit your API key for twilio. Use the environment varibles:
TWILIO_ACCOUNT_SID
TWILIO_AUTH_TOKEN
- Don't forget that you should never commit your API key for twilio. Use the environment varibles:
- PySimpleGui DOCS
- pytest DOCS
Pi Setup
- 8MP Camera
- RPi 4 Model B w/ 4GB RAM
- Available in 1GB, 2GB, 4GB models
- Pi SD Card
- 5MP Camera
- Need Case for Pi
- Battery Pack (200 IQ: Battery Case?)
The raspberry pi will use a lightweight version of Raspbian. Our goal is to include the project within a docker image to eliminate the possibility of enviroment issues.
We are using OpenCV with the dlib library to recognize faces. The dlib library has been trained on over 3 million faces.
PySimpleGui is an awesome and easy-to-use tkinter wrapper. It is great for Raspberry Pi's and simple applications.
Using Travis CI for automatic testing