Skip to content

Overview of different loss functions for generating face embeddings

Notifications You must be signed in to change notification settings

alexkrz/face-embeddings

Repository files navigation

Face Embeddings

python black pytorch lightning

This repository integrates and extends the code from https://github.com/jonasgrebe/pt-femb-face-embeddings.

The datasets for training can be downloaded from the Insightface Datasets Github Page. The training datasets are provided in mxnet RecordIO file format.

Set up repository

  1. Install miniconda

  2. Create environment with

    conda env create -n femb -f environment.yml
  3. Install pip requirements with

    conda activate femb
    pip install -r requirements.txt
  4. Install pre-commit hooks with

    pre-commit install

Run training and inference

We provide a train script and a predict script that can be executed with a matching config file.

Example for training:

python train.py --config configs/train_arcface_ddp.yaml

Example for prediction:

python predict.py --config configs/predict_arcface.yaml

To generate predictions on the official model checkpoints, you first need to download the checkpoints and put them into the checkpoints/ directory.

Checkpoints for ArcFace can be downloaded at: Arcface Repository

Checkpoints for MagFace can be downloaded at: MagFace Repository

Model references

Backbone

Headers

Todos

  • Load ArcFace checkpoint from official Arcface repository
  • Train own ArcFace model and save it compatible to official Arcface checkpoint
  • Add ElasticFace header
  • Compare MagFace training to official Magface code
  • Remove mxnetdependency. Therefore it is necessary to convert the datasets.

About

Overview of different loss functions for generating face embeddings

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published