基于Paddle框架的arcface复现

Overview

arcface-Paddle

基于Paddle框架的arcface复现

ArcFace-Paddle

本项目基于paddlepaddle框架复现ArcFace,并参加百度第三届论文复现赛,将在2021年5月15日比赛完后提供AIStudio链接~敬请期待

参考项目:

InsightFace

Paddle版本:

paddlepaddle-gpu==2.0.2

数据集

MS1M-ArcFace 解压数据集,你应该得到以下目录结构

faces_more
|───property
└───cplfw.bin
└───agedb_30.bin
└───vgg2_fp.bin
└───lfw.bin
└───cfp_ff.bin
└───cfp_fp.bin
└───calfw.bin
└───train.rec
└───train.idx

其中train.rec包含训练的图像,train.idx包含训练的标签,其均为mxnet数据格式,其余.bin文件均为二进制bytes文件

训练

整个工程文件具有以下目录结构

|───faces_more
└───eval
└───mxnet_reader
└───mxnet_reader_win10
└───backbones
└───paddle_pretrainedmodel
└───utils
└───dataset.py
└───losses.py
└───partial_fc.py
└───config.py
└───train.py

注意:mxnet_reader用于Linux系统部署训练,mxnet_reader_win10用于win10系统部署训练,两者均为重构mxnet数据读取后的代码

配置说明

config.py里面包含训练的超参数,学习率衰减函数,训练文件路径以及验证文件列表

backbones里面包含提供的训练模型,iresnet18iresnet34iresnet50iresnet100iresnet200

partial_fc来源于论文《Partial FC: Training 10 Million Identities on a Single Machine》,其目的是加速训练超大规模数据集

paddle_pretrainedmodel包含网络的预训练文件,其均为由torch模型转换而来,里面包含测试代码model_test.py以及精度文件results.txt

启动训练

python train.py [--network XXX]

这将会在log文件夹下产生训练的日志文件,其包括损失值以及所需训练的的时间,工程中的training.log包含了部分训练过程中的打印信息

训练过程中的权重文件将保存在emore_arcface_r50文件夹下,保存路径源于你的config文件设置,你应具有以下类似目录

|───emore_arcface_r50
└───backbone.pdparams
└───rank:0_softmax_weight.pkl
└───rank:0_softmax_weight_mom.pkl

本次利用aistudio训练的iresnet50得到的backbone.pdparams精度如下,其中lfw=0.99750cplfw=0.92117calfw=0.96017,你可以通过修改/home/aistudio/paddle_pretrainedmodel/ model_test.py权重路径model_params=/home/aistudio/emore_arcface_r50/backbone.pdparams来测试自己的模型

由于aistudio对保存版本文件的限制,我将保存的文件已上传至我的服务器,你可以通过wget ftp://207.246.98.85/emore_arcface_r50.zip下载获取

启动测试

模型和数据集读取代码下载

提取码:dzc0

AIStudio链接

cd /home/aistudio/paddle_pretrainedmodel
python model_test.py [--network XXX]

注意到model_test.py测试的官方提供的预训练模型,测试自己的训练模型,你需要修改读取文件的路径以及网络结构

关于作者

姓名 郭权浩
学校 电子科技大学研2020级
研究方向 计算机视觉
主页 Deep Hao的主页
如有错误,请及时留言纠正,非常蟹蟹!
后续会有更多论文复现系列推出,欢迎大家有问题留言交流学习,共同进步成长!
Owner
QuanHao Guo
master at UESTC
QuanHao Guo
Implementation for our ICCV2021 paper: Internal Video Inpainting by Implicit Long-range Propagation

Implicit Internal Video Inpainting Implementation for our ICCV2021 paper: Internal Video Inpainting by Implicit Long-range Propagation paper | project

202 Dec 30, 2022
O2O-Afford: Annotation-Free Large-Scale Object-Object Affordance Learning (CoRL 2021)

O2O-Afford: Annotation-Free Large-Scale Object-Object Affordance Learning Object-object Interaction Affordance Learning. For a given object-object int

Kaichun Mo 26 Nov 04, 2022
Face and other object detection using OpenCV and ML Yolo

Object-and-Face-Detection-Using-Yolo- Opencv and YOLO object and face detection is implemented. You only look once (YOLO) is a state-of-the-art, real-

Happy N. Monday 3 Feb 15, 2022
This repository contains tutorials for the py4DSTEM Python package

py4DSTEM Tutorials This repository contains tutorials for the py4DSTEM Python package. For more information about py4DSTEM, including installation ins

11 Dec 23, 2022
OpenMMLab's Next Generation Video Understanding Toolbox and Benchmark

Introduction English | 简体中文 MMAction2 is an open-source toolbox for video understanding based on PyTorch. It is a part of the OpenMMLab project. The m

OpenMMLab 2.7k Jan 07, 2023
This repo includes our code for evaluating and improving transferability in domain generalization (NeurIPS 2021)

Transferability for domain generalization This repo is for evaluating and improving transferability in domain generalization (NeurIPS 2021), based on

gordon 9 Nov 29, 2022
SlotRefine: A Fast Non-Autoregressive Model forJoint Intent Detection and Slot Filling

SlotRefine: A Fast Non-Autoregressive Model for Joint Intent Detection and Slot Filling Reference Main paper to be cited (Di Wu et al., 2020) @article

Moore 34 Nov 03, 2022
Additional code for Stable-baselines3 to load and upload models from the Hub.

Hugging Face x Stable-baselines3 A library to load and upload Stable-baselines3 models from the Hub. Installation With pip Examples [Todo: add colab t

Hugging Face 34 Dec 10, 2022
Image marine sea litter prediction Shiny

MARLITE Shiny app for floating marine litter detection in aerial images. This directory contains the instructions and software needed to install the S

19 Dec 22, 2022
Metric learning algorithms in Python

metric-learn: Metric Learning in Python metric-learn contains efficient Python implementations of several popular supervised and weakly-supervised met

1.3k Dec 28, 2022
Implementation of TransGanFormer, an all-attention GAN that combines the finding from the recent GanFormer and TransGan paper

TransGanFormer (wip) Implementation of TransGanFormer, an all-attention GAN that combines the finding from the recent GansFormer and TransGan paper. I

Phil Wang 146 Dec 06, 2022
Acute ischemic stroke dataset

AISD Acute ischemic stroke dataset contains 397 Non-Contrast-enhanced CT (NCCT) scans of acute ischemic stroke with the interval from symptom onset to

Kongming Liang 21 Sep 06, 2022
Exploration-Exploitation Dilemma Solving Methods

Exploration-Exploitation Dilemma Solving Methods Medium article for this repo - HERE In ths repo I implemented two techniques for tackling mentioned t

Aman Mishra 6 Jan 25, 2022
A pytorch implementation of Reading Wikipedia to Answer Open-Domain Questions.

DrQA A pytorch implementation of the ACL 2017 paper Reading Wikipedia to Answer Open-Domain Questions (DrQA). Reading comprehension is a task to produ

Runqi Yang 394 Nov 08, 2022
A Moonraker plug-in for real-time compensation of frame thermal expansion

Frame Expansion Compensation A Moonraker plug-in for real-time compensation of frame thermal expansion. Installation Credit to protoloft, from whom I

58 Jan 02, 2023
Official implementation of the paper "Light Field Networks: Neural Scene Representations with Single-Evaluation Rendering"

Light Field Networks Project Page | Paper | Data | Pretrained Models Vincent Sitzmann*, Semon Rezchikov*, William Freeman, Joshua Tenenbaum, Frédo Dur

Vincent Sitzmann 130 Dec 29, 2022
A PyTorch implementation of QANet.

QANet-pytorch NOTICE I'm very busy these months. I'll return to this repo in about 10 days. Introduction An implementation of QANet with PyTorch. Any

H. Z. 343 Nov 03, 2022
Resco: A simple python package that report the effect of deep residual learning

resco Description resco is a simple python package that report the effect of dee

Pierre-Arthur Claudé 1 Jun 28, 2022
Repository for self-supervised landmark discovery

self-supervised-landmarks Repository for self-supervised landmark discovery Requirements pytorch pynrrd (for 3d images) Usage The use of this models i

Riddhish Bhalodia 2 Apr 18, 2022
Unified MultiWOZ evaluation scripts for the context-to-response task.

MultiWOZ Context-to-Response Evaluation Standardized and easy to use Inform, Success, BLEU ~ See the paper ~ Easy-to-use scripts for standardized eval

Tomáš Nekvinda 38 Dec 13, 2022