fast face classification

Overview

Fast Face Classification (F²C)—— An Efficient Training Approach for Very Large Scale Face Recognition

Training on ultra-large-scale datasets is time-consuming and takes up a lot of hardware resource. Therefore so we design a dul-data loaders and dynamic class pool to deal with large-scale face classification.

Pipeline

Arch

Preparation

As FFC contains LRU module, so you may use lru_python_impl.py or instead compile the code under lru_c directory.

If you choose lru_python_impl.py, you should rename lru_python_impl.py to lru_utils.py. As lru is not the bottleneck of the training procedure, so feel free to use python implementation, though the C++ implementation is 5~10 times faster than python version.

Compile LRU (optional)

Command to build LRU

cd lru_c
mkdir build
cd build
cmake ..
make
cd ../../ && ln -s lru_c/build/lru_utils.so .

You can compare this two implementation using lru_c/python/compare_time.py

Database

Training

In main.py, you should provide the path to your training db at line 152-153.

args.source_lmdb = ['/path to msceleb.lmdb']
args.source_file = ['/path to kv file']

We choose lmdb as the format of our training db. Each element in source_file is the path to a text file, each line of which represents lmdb_key label pairs. You may refer to LFS for more details.

Now you can modify train_ffc.sh. Before running the training, you should set the port number and queue_size. queue_size is a trade-off term that controls the performance and the speed. Larger queue_size means higher performance at the cost of time and GPU resource. It can be any positive integer. The common setting is 1%, 0.1%, 0.001 % of the total identities.

Notice

The difference between r50 and ir50 is that r50 requires 224 × 224 images as input while ir50 requires 112 × 112 as what does by ArcFace. The network ir50 comes from ArcFace.

Evaluation

We provide the whole test script under evaluation_code directory. Each script requires the directory to the images and test pair files.

Tips

Code in evaluation_code/test_megaface.py is much faster than official version. It's also applicable to extremely large-scale testing.

You might also like...
Android face detect and segmentation by ncnn
Android face detect and segmentation by ncnn

Android face detect and segmentation by ncnn

This is the code of our paper An Efficient Training Approach for Very Large Scale Face Recognition or F²C for simplicity.
This is the code of our paper An Efficient Training Approach for Very Large Scale Face Recognition or F²C for simplicity.

Fast Face Classification (F²C) This is the code of our paper An Efficient Training Approach for Very Large Scale Face Recognition or F²C for simplicit

Deploy SCRFD, an efficient high accuracy face detection approach, in your web browser with ncnn and webassembly

ncnn-webassembly-scrfd open https://nihui.github.io/ncnn-webassembly-scrfd and enjoy build and deploy Install emscripten

Face tracking plugin for OBS Studio

OBS Face Tracker Plugin Introduction This plugin provide a filter for face detection and face tracking for mainly a speaking person. This plugin emplo

Chunky pixel watch face for SQFMI's Watchy

pxl999 Pxl999 is a chunky pixel watch face for SQFMI's Watchy. This watch face features live weather updates every 30 minutes and NTP syncing twice a

GFPGAN-ncnn - a naive NCNN implementation of GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration
GFPGAN-ncnn - a naive NCNN implementation of GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration

GFPGAN-ncnn a naive ncnn implementation of GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration model support: 1.GFPGANClean

Fast and robust certifiable relative pose estimation

Fast and Robust Relative Pose Estimation for Calibrated Cameras This repository contains the code for the relative pose estimation between two central

A light and fast internet speed plugin(DDE).
A light and fast internet speed plugin(DDE).

lfxNet English | 简体中文 | 繁體中文 lfxNet 是一款轻量、快速的实时显示系统资源信息的应用程序。 目录 背景 编译 下载 作者 鸣谢 协议 背景 喜爱 DDE ,为 Deepin 爱好者、也是开发者之一。因习惯其它系统上有一个任务栏网速插件,但在 Deepin/UOS上没有

fast zksnark prover

rapidsnark rapid snark is a zkSnark proof generation written in C++ and intel assembly. That generates proofs created in circom and snarkjs very fast.

Comments
  • what is the difference/advantage of FFC comparing with DCQ?

    what is the difference/advantage of FFC comparing with DCQ?

    Indeed, I wish FFC can solve my problem of GPU memory limitation without damaging the model performance. so can you describe more details about the difference/advantage of FFC comparing with DCQ? thanks in advance !

    opened by Noobzm 0
  • Qs for paper

    Qs for paper

    您好,感谢您的工作。有些疑问希望可以得到您的解答:

    1. 原文中阐述了instance-based的两个问题,但是第二个问题是否已经被CVPR 2021 DCQ那篇文章解决?第一个问题在DCQ中仍然存在,但是改进了这个问题好像结果并没有比DCQ好?
    2. 原文中阐述的这两个问题,是如何影响实验结果呢?更具体来说,您定义的更新速度这个变量会影响最终识别的结果吗,更新快意味着结果好吗?【1. If the number of identities is severely imbalanced, the update speed of the identities’ centers that have rare number of images is too slow. 2. If we sample M images that belong to M different identities, the DCP may have no positive samples for this iteration】
    opened by zws98 1
  • argument world_size: invalid int value

    argument world_size: invalid int value

    if world_size=8 then error: argument world_size: invalid int value

    for one server which have 8 gpu cart, the value of "world_size" can be setted as what?

    thanks

    opened by xiakj 5
  • Paper Implementation

    Paper Implementation

    Dear @tiandunx

    Thank you for your work. In the Virtual FC paper at CVPR 2021, we have to change the network HEAD and replace it with the Virtual FC layer which takes two parameters in_feat and out_feat. Is your work like them? because I saw your code and didn't get any clear definition. If possible for you, please mention some small examples, because I want to use your layer in my network.

    Regards, Khawar

    opened by khawar-islam 7
Owner
null
A fast, scalable, high performance Gradient Boosting on Decision Trees library, used for ranking, classification, regression and other machine learning tasks for Python, R, Java, C++. Supports computation on CPU and GPU.

Website | Documentation | Tutorials | Installation | Release Notes CatBoost is a machine learning method based on gradient boosting over decision tree

CatBoost 6.9k Dec 31, 2022
A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks.

Light Gradient Boosting Machine LightGBM is a gradient boosting framework that uses tree based learning algorithms. It is designed to be distributed a

Microsoft 14.5k Jan 5, 2023
Fast and robust face tracking addon for openFrameworks based on YOLO5Face

ofxFaceTracker3 Working in progress Fast and robust face tracking addon for openFrameworks based on YOLO5Face and ONNX Runtime. Features Fast and robu

Yuya Hanai 13 Nov 6, 2022
Training and Evaluating Facial Classification Keras Models using the Tensorflow C API Implemented into a C++ Codebase.

CFace Training and Evaluating Facial Classification Keras Models using the Tensorflow C API Implemented into a C++ Codebase. Dependancies Tensorflow 2

null 7 Oct 18, 2022
Learning embeddings for classification, retrieval and ranking.

StarSpace StarSpace is a general-purpose neural model for efficient learning of entity embeddings for solving a wide variety of problems: Learning wor

Facebook Research 3.8k Dec 22, 2022
Using image classification with ConvMixer

Japanese Handwriting Classification with Fragment Shaders NOTE: This was built and tested with Unity 2019.4.31f1 using built-in render pipeline, there

null 11 Nov 22, 2022
DeepI2P - Image-to-Point Cloud Registration via Deep Classification. CVPR 2021

#DeepI2P: Image-to-Point Cloud Registration via Deep Classification Summary Video PyTorch implementation for our CVPR 2021 paper DeepI2P. DeepI2P solv

Li Jiaxin 138 Jan 8, 2023
MobileNet Image Classification with ESP32-CAM and Edge Impulse (TinyML)

MobileNet Image Classification on ESP32-CAM and Edge Impulse (TinyML) This example is for running a MobileNet neural network model on a 10-dollar Ai-T

Alan Wang 16 Dec 19, 2022
OpenPose: Real-time multi-person keypoint detection library for body, face, hands, and foot estimation

Build Type Linux MacOS Windows Build Status OpenPose has represented the first real-time multi-person system to jointly detect human body, hand, facia

null 25.6k Dec 29, 2022
The SCRFD face detection, depends on ncnn library and opencv

The SCRFD face detection, depends on ncnn library and opencv

null 157 Jan 5, 2023