Giter Club home page Giter Club logo

face-comparison-app's Introduction

face-comparison

AI Face comparison using FaceNet, compare two photos and see if they are the same person.

Installation

pip install face-compare

Usage

Use compare_faces.py to compare two images of people to see if they are the same person.

compare_faces.py --image-one /path/to/image_one.png --image-two /path/to/image_two.png

Optionally output the cropped image output to a directory (useful for inspecting input to AI model)

compare_faces.py --image-one /path/to/image_one.png --image-two /path/to/image_two.png -s /path/to/outputs/

Steps Involved

  1. A cascade classifier is used to detect the face within the input images.
  2. The bounding box of this segmentation is then used to crop the images, and fed into the AI model.
  3. The FaceNet model then calculates the image embeddings for the two cropped images.
  4. Finally the second embedding is subtracted from the first, and the Euclidean norm of that vector is calculated.
  5. A threshold of 0.7 is used to determine whether they are the same person or not.

Known Issues

CPU Only runtime issue

If you are trying to run the module without a suitable GPU, you may run into the following error message:

tensorflow.python.framework.errors_impl.InvalidArgumentError:  Default MaxPoolingOp only supports NHWC on device type CPU

To fix this issue with Intel CPU architecture, you can install the TensorFlow Intel Optimization package via

pip install intel-tensorflow

References

This module uses the AI model FaceNet, which can be found here, and the journal article here.

face-comparison-app's People

Contributors

m-lyon avatar dependabot[bot] avatar poeticdeath avatar saharmor avatar kotesitory avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.