Mac OS X comes with Python 2.7 out of the box. However, this project uses Python 3.7 so we'll install it using Homebrew:
brew install pythonYou'll probably need to augment your PATH in .bash_profile or .zshrc, too:
export PATH="/usr/local/opt/python/libexec/bin:$PATH"If you're using Linux or Windows, you'll need to work this bit out yourself.
This project uses Poetry to manage packages and environments. Frankly, I couldn't find a viable alternative amongst the vast menagerie of whacky and incomplete Python package managers. PyPI is still terrible so packages aren't any easier to find but at least we won't need to fight with Pip and Virtualenv:
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | pythonYou still might need to install Pip and Virtualenv so Poetry can use them behind the scenes.
If you're running MacOS and the many malevolent gods of the Python ecosystem are smiling upon you today, you should just be able to install the dependencies using Poetry:
poetry installBefore running the script, save a .jpg for each face you want to match in the faces directory. Training will happen automatically before the first run and the name of the file will be the identifier for that face.
/faces
├── john-doe.jpg
└── jenna-bloggs.jpgIf you want to retrain the script with new faces just delete faces/faces.npy:
rm faces/faces.npyIf you're holding a lucky rabbit's foot and pigs have been flying in your little corner of the infinite multiverse since the emergence of the cosmos, you can just run:
poetry run python main.pyThis tool is based on several different tools and is made possible in no small part by the hard work of engineers much more talented than myself, including but not limited to: