Giter Site home page Giter Site logo

mobile-arcface-torch's Introduction

Face Verification for Mobile

Train face verification model with ArcFace implemented with PyTorch. Models are intended to be used on mobile devices.

Install

This repo is tested with Python 3.7 and PyTorch 1.13. Other packages' versions can be found in requirements.txt.

Setup the dataset

This project use 2 datasets:

MS1Mv3 for training

  • Download and extract the dataset here
  • In the config file configs/ms1mv3_mbf.py, modify the config.root_dir value with the path to the extracted folder containing the MS1Mv3 dataset.

LFW for validation

  • Download and extract the deep funneled version here. In the config file configs/ms1mv3_mbf.py, modify the img_dir value of config.lfwpair_kwargs with the path to the extracted folder containing LFW images.

  • Download the pairs.txt here. In the config file configs/ms1mv3_mbf.py, modify the pairs_txt_path value of config.lfwpair_kwargs with the path to the pairs.txt file.

Train

Run python train.py. You can modify the config.batch_size in the config file to fit your GPU memory if needed.

Then run tensorboard --logdir ./lightning_logs to view the training progress in realtime.

The best checkpoint will be saved in the corressponding folder in ./lightning_logs/.

Metrics logged during training

  • mean_target_cosine: Training metric - Mean value in each batch of cosine similarity between the image and the target class cluster center
  • train_loss: ArcFace loss
  • lfw_auroc: Validation metric - AUC ROC based on predictions of LFW pair images.
  • pos_mean_score: Validation metric - Mean similarity score of all matching pair images
  • neg_mean_score: Validation metric - Mean similarity score of all mismatch pair images

mobile-arcface-torch's People

Contributors

nntrongnghia avatar

Stargazers

Charley Xiao avatar

Watchers

 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.