/Face-Recognition-pipeline-using-SOTA-ArcFace

Face Recognition pipeline using SOTA ArcFace using Pytorch

Primary LanguageJupyter Notebook

Face-Recognition-pipeline-using-SOTA-ArcFace

Face Recognition pipeline using SOTA ArcFace using Pytorch is inspired from the paper ArcFace: Additive Angular Margin Loss for Deep Face Recognition

Git repo: Insightface_Pytorch

Problem Statement

The problem statement for face recognition task can be found SkylarkLabs-ai-link

Dataset

The folders contain around 50 cropped face images of each avenger can be found from kaggle Avengers face recognition!

  1. Chris Evans (Captain America)
  2. Chris Hemsworth (Thor)
  3. Mark Ruffalo (Hulk)
  4. Robert DowneyJr (The Iron man)
  5. Scarlett Johansson (Black Widow)

The dataset zip file or folder can be found from drive link

Notebook

The detailed code implementation for the ArcFace implementation using pytorch can be found from colab notebook

Best Model

ML Pipeline

The train.py, test.py and related utilities to execute train, test pipeline can be found from utilities folder

Guide to run

  1. Download and unzip the dataset from here

  2. Git clone the repo - repo_name

    git clone [repo_name]
  1. Navigate to repo to install dependencies from - requirements.txt
    cd Face-Recognition-pipeline-using-SOTA-ArcFace
    pip install -r requirements.txt
  1. Navigate to "utilities folder" which contains dependencies to run the pipeline - utilities_path
    cd [utilities_path]
  1. Execute train pipeline - pre-trained-mobilefacenet model folder. The train_pipeline code can be tweaked little to change the pre-trained model file.
    python train.py -dataset [dataset_path] -model [pre-trained-mobilefacenet model folder]
  1. Execute test pipeline -
  • trained_mode_folder. The train_pipeline code can be tweaked little to change the pre-trained model file.
  • csv_folder_demo, the path where the train, valid, test csv files are stored from the dataframe
    python test.py -dataset [dataset_path] -model [trained_mode_folder] -df [csv_folder]
  • A simple demo of that train, test pipeline can be found here.
  • Docker implementation in colab can be found here, though it needs more testing to execute the layers.

Reference