I tried the facial recognition library for Python ageitgey/face_recognition.
This library uses dlib, a toolkit written in C++ that contains machine learning algorithms. For example, I’m trying to check if an actor is playing in the TV series “The Big Bang Theory”. A test image with an actor is compared to real actors filmed in a TV show.
I wrote a web service that uses python face_recognition library for face recognition from image and compares the recognized face with the data stored in the database.
Information can be sent to the server via a POST request or a web form. The server returns the status 200 OK with the name of the person in JSON found by the photo in the database or the status 404 NOT FOUND.
The web service is written with Django. PostgreSQL is used as the database. Gunicorn is used as the application server. Nginx is used as a proxy server for sending static files.
The working solution is packaged in a docker container. For rapid deployment on the server, I wrote a docker-compose configuration file. For development and production, I made different docker-compose configuration files. The entire project is on GitHub.
For testing, I deployed the service on DigitalOcean. I used a droplet with Ubuntu 20.04. Docker and docker-compose installed on the server according to the instructions on the link Install Docker Engine on Ubuntu. To build the project, you need at least 2GB of RAM.