Skip to content

soumik12345/Nearest-Celebrity-Face

Repository files navigation

Nearest-Celebrity-Face

HitCount

PWC PWC PWC PWC PWC

Overview

Implementation of FaceNet: A Unified Embedding for Face Recognition and Clustering to find the celebrity whose face matches the closest to yours. The input face is encoded with a pretrained inception model into a vector and then its geometric distance is calculated with the encoded vectors of all the images present in the dataset and the image with the least distance is selected.

Article Link: https://soumik12345.github.io/geekyrakshit-blog/computervision/deeplearning/facenet/inception/keras/nearestcelebrityface/python/tensorflow/2019/08/07/nearest-celebrity-face.html

Installation

  1. Create a new conda environment using conda create --name nearest_celeb_face
  2. Activate the activate nearest_celeb_face if you are on Windows and source activate nearest_celeb_face if you are on Linux
  3. Clone the repository using git clone https://github.com/soumik12345/Nearest-Celebrity-Face
  4. Enter the root directory using cd Nearest-Celebrity-Face
  5. Install the required dependencies using pip install -r requirements.txt

Usage

The TestCases folder contains two folders Actual that contains full sized images of individuals and Preprocessed containing the faces manually cropped out of the full sized images. Any number of testcases can be added provided that one image each is present in the Actual and Preprocessed folders with the exact same filename and the preprocessed image should have the face manually cropped out for best performance. Refer to the already cropped images for further detail on how to crop. Once the tescases are setup, run python main.py or python3 main.py to run the program.

Sample Outputs

Citation

@article{1503.03832,
  Author = {Florian Schroff and Dmitry Kalenichenko and James Philbin},
  Title = {FaceNet: A Unified Embedding for Face Recognition and Clustering},
  Year = {2015},
  Eprint = {arXiv:1503.03832},
  Doi = {10.1109/CVPR.2015.7298682},
}