A simple face detection API made with Python Flask and FastAPI, using the Deepface library.
- Python
- Flask
- Deepface
- Deepface: https://github.com/serengil/deepface
- Clone the repository
- Install the dependencies with Poetry:
- Install Poetry
with
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
orpip install poetry
- Install the packages with
poetry install
- Start a poetry shell with
poetry shell
- Install Poetry
with
- Start the Flask development server with
flask run
- Start the FastAPI development server with
uvicorn fast_app:app
If you encounter any errors during installation, try the following steps:
- Remove the
pyproject.toml
andpoetry.lock
files - For MacOS with M1, run:
poetry add tensorflow-macos tensorflow-Metal fastapi flask pillow
- Start a Poetry shell with
poetry shell
- Install Deepface without dependencies by running
pip install deepface --no-deps
Before running the API, make sure to check that you have all the required dependencies installed and configured correctly.