基于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
Evaluating Cross-lingual Sentence Representations

XNLI: The Cross-Lingual NLI Corpus XNLI is an evaluation corpus for language transfer and cross-lingual sentence classification in 15 languages. New:

Meta Research 395 Dec 19, 2022
Clockwork Convnets for Video Semantic Segmentation

Clockwork Convnets for Video Semantic Segmentation This is the reference implementation of arxiv:1608.03609: Clockwork Convnets for Video Semantic Seg

Evan Shelhamer 141 Nov 21, 2022
Official PyTorch Implementation for "Recurrent Video Deblurring with Blur-Invariant Motion Estimation and Pixel Volumes"

PVDNet: Recurrent Video Deblurring with Blur-Invariant Motion Estimation and Pixel Volumes This repository contains the official PyTorch implementatio

Junyong Lee 98 Nov 06, 2022
Train the HRNet model on ImageNet

High-resolution networks (HRNets) for Image classification News [2021/01/20] Add some stronger ImageNet pretrained models, e.g., the HRNet_W48_C_ssld_

HRNet 866 Jan 04, 2023
Reimplementation of Learning Mesh-based Simulation With Graph Networks

Pytorch Implementation of Learning Mesh-based Simulation With Graph Networks This is the unofficial implementation of the approach described in the pa

Jingwei Xu 33 Dec 14, 2022
SegNet including indices pooling for Semantic Segmentation with tensorflow and keras

SegNet SegNet is a model of semantic segmentation based on Fully Comvolutional Network. This repository contains the implementation of learning and te

Yuta Kamikawa 172 Dec 23, 2022
🤗 Paper Style Guide

🤗 Paper Style Guide (Work in progress, send a PR!) Libraries to Know booktabs natbib cleveref Either seaborn, plotly or altair for graphs algorithmic

Hugging Face 66 Dec 12, 2022
Repo for paper "Dynamic Placement of Rapidly Deployable Mobile Sensor Robots Using Machine Learning and Expected Value of Information"

Repo for paper "Dynamic Placement of Rapidly Deployable Mobile Sensor Robots Using Machine Learning and Expected Value of Information" Notes I probabl

Berkeley Expert System Technologies Lab 0 Jul 01, 2021
Face Mask Detection system based on computer vision and deep learning using OpenCV and Tensorflow/Keras

Face Mask Detection Face Mask Detection System built with OpenCV, Keras/TensorFlow using Deep Learning and Computer Vision concepts in order to detect

Chandrika Deb 1.4k Jan 03, 2023
This repository for project that can Automate Number Plate Recognition (ANPR) in Morocco Licensed Vehicles. 💻 + 🚙 + 🇲🇦 = 🤖 🕵🏻‍♂️

MoroccoAI Data Challenge (Edition #001) This Reposotory is result of our work in the comepetiton organized by MoroccoAI in the context of the first Mo

SAFOINE EL KHABICH 14 Oct 31, 2022
PyTorch implementation of the ACL, 2021 paper Parameter-efficient Multi-task Fine-tuning for Transformers via Shared Hypernetworks.

Parameter-efficient Multi-task Fine-tuning for Transformers via Shared Hypernetworks This repo contains the PyTorch implementation of the ACL, 2021 pa

Rabeeh Karimi Mahabadi 98 Dec 28, 2022
A Python package for causal inference using Synthetic Controls

Synthetic Control Methods A Python package for causal inference using synthetic controls This Python package implements a class of approaches to estim

Oscar Engelbrektson 107 Dec 28, 2022
The aim of the game, as in the original one, is to find a specific image from a group of different images of a person's face

GUESS WHO Main Links: [Github] [App] Related Links: [CLIP] [Celeba] The aim of the game, as in the original one, is to find a specific image from a gr

Arnau - DIMAI 3 Jan 04, 2022
2D&3D human pose estimation

Human Pose Estimation Papers [CVPR 2016] - 201511 [IJCAI 2016] - 201602 Other Action Recognition with Joints-Pooled 3D Deep Convolutional Descriptors

133 Jan 02, 2023
DANet for Tabular data classification/ regression.

Deep Abstract Networks A pyTorch implementation for AAAI-2022 paper DANets: Deep Abstract Networks for Tabular Data Classification and Regression. Bri

Ronnie Rocket 55 Sep 14, 2022
Simple tutorials on Pytorch DDP training

pytorch-distributed-training Distribute Dataparallel (DDP) Training on Pytorch Features Easy to study DDP training You can directly copy this code for

Ren Tianhe 188 Jan 06, 2023
This codebase is the official implementation of Test-Time Classifier Adjustment Module for Model-Agnostic Domain Generalization (NeurIPS2021, Spotlight)

Test-Time Classifier Adjustment Module for Model-Agnostic Domain Generalization This codebase is the official implementation of Test-Time Classifier A

47 Dec 28, 2022
Code for "Localization with Sampling-Argmax", NeurIPS 2021

Localization with Sampling-Argmax [Paper] [arXiv] [Project Page] Localization with Sampling-Argmax Jiefeng Li, Tong Chen, Ruiqi Shi, Yujing Lou, Yong-

JeffLi 71 Dec 17, 2022
Learning Lightweight Low-Light Enhancement Network using Pseudo Well-Exposed Images

Learning Lightweight Low-Light Enhancement Network using Pseudo Well-Exposed Images This repository contains the implementation of the following paper

Seonggwan Ko 9 Jul 30, 2022
Keras Image Embeddings using Contrastive Loss

Image to Embedding projection in vector space. Implementation in keras and tensorflow of batch all triplet loss for one-shot/few-shot learning.

Shravan Anand K 5 Mar 21, 2022