Skip to content

limkhashing/Face-Matching

Repository files navigation

Face Matching

Build Status codecov Python Version Side Project

This is a simple Python/Flask application that intended to compare face that found in an image and short video. It will return a JSON whether face found in image and video, a confidence percentage and whether is matched or not

Tech/Framework used

Installing on Unix or Windows

To run this project, install it locally using pip on a virtual environment

pip install -r requirements.txt

How does it work

  1. Upload a picture of the person you want to compare
  2. Upload a short video (mp4, avi, webm)
  3. Click compare and it will compare the face found in picture and video
    • Check the size of picture uploaded. If is above certain threshold, then it will be compress
    • Extract frame per second from video uploaded
      • Check the frame whether is rotated. If is rotated, rotate it back to portrait
    • Check the size of frame extracted. If is above certain threshold, then it will be compress
    • Loop through and comparing the picture and frames extracted. Confidence will be divided by how many frame counts

flowchart

Deployment

  • Deployment was done by using Heroku
  • Procfile is used to specifies the commands that are executed by the app on startup.
  • Aptfile is used to install additional software packages that application requires
  • newrelic.ini is use for New Relic add-on for monitoring

You can try the web app that hosted here https://matching-face.herokuapp.com/ Starting November 28, 2022, Heroku stop offering free product plans and plan to start shutting down free dynos and data services. Hence the web app is no longer available

Issues when deploying on Heroku / VM / Dockers

There are some issues when trying to deploy this app on the web. Please see the link below for the fix.
Some of the issues are

Authors

Lim Kha Shing