/flask_face_detection

Face detection example in Python 3 based on OpenCV and Flask

Primary LanguagePythonMIT LicenseMIT

Face detection demo (Flask app)

This is a very simple Flask app that let's the user upload a image and detects how many (if any) faces are there in the picture.

Hosting on Heroku

Try it here.

Generate pipfile with command:

pipenv install opencv-contrib-python

pipenv install Flask

pipenv install gunicorn

pipenv install numpy

Add the following buildpack:

https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-apt

and include a list of apt package names to be installed in the Aptfile (more details here: https://stackoverflow.com/a/51004957/660711)

Docker

Docker container based on: https://hub.docker.com/r/shosoar/alpine-python-opencv/

To build the docker image and run locally:

cd face_detection_flask

docker build -t face_detection_flask .

docker run -it -p 3000:80 face_detection_flask