基于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
Jarvis Project is a basic virtual assistant that uses TensorFlow for learning.

Jarvis_proyect Jarvis Project is a basic virtual assistant that uses TensorFlow for learning. Latest version 0.1 Features: Good morning protocol Tell

Anze Kovac 3 Aug 31, 2022
Sequential model-based optimization with a `scipy.optimize` interface

Scikit-Optimize Scikit-Optimize, or skopt, is a simple and efficient library to minimize (very) expensive and noisy black-box functions. It implements

Scikit-Optimize 2.5k Jan 04, 2023
Dist2Dec: A Simplicial Neural Network for Homology Localization

Dist2Dec: A Simplicial Neural Network for Homology Localization

Alexandros Keros 6 Jun 12, 2022
Probabilistic Gradient Boosting Machines

PGBM Probabilistic Gradient Boosting Machines (PGBM) is a probabilistic gradient boosting framework in Python based on PyTorch/Numba, developed by Air

Olivier Sprangers 112 Dec 28, 2022
Official Pytorch implementation of "CLIPstyler:Image Style Transfer with a Single Text Condition"

CLIPstyler Official Pytorch implementation of "CLIPstyler:Image Style Transfer with a Single Text Condition" Environment Pytorch 1.7.1, Python 3.6 $ c

203 Dec 30, 2022
Multi-Scale Geometric Consistency Guided Multi-View Stereo

ACMM [News] The code for ACMH is released!!! [News] The code for ACMP is released!!! About ACMM is a multi-scale geometric consistency guided multi-vi

Qingshan Xu 118 Jan 04, 2023
A general python framework for visual object tracking and video object segmentation, based on PyTorch

PyTracking A general python framework for visual object tracking and video object segmentation, based on PyTorch. 📣 Two tracking/VOS papers accepted

2.6k Jan 04, 2023
Source code for our paper "Molecular Mechanics-Driven Graph Neural Network with Multiplex Graph for Molecular Structures"

Molecular Mechanics-Driven Graph Neural Network with Multiplex Graph for Molecular Structures Code for the Multiplex Molecular Graph Neural Network (M

shzhang 59 Dec 10, 2022
PyTorch implementation of ShapeConv: Shape-aware Convolutional Layer for RGB-D Indoor Semantic Segmentation.

Shape-aware Convolutional Layer (ShapeConv) PyTorch implementation of ShapeConv: Shape-aware Convolutional Layer for RGB-D Indoor Semantic Segmentatio

Hanchao Leng 82 Dec 29, 2022
Dynamic Multi-scale Filters for Semantic Segmentation (DMNet ICCV'2019)

Dynamic Multi-scale Filters for Semantic Segmentation (DMNet ICCV'2019) Introduction Official implementation of Dynamic Multi-scale Filters for Semant

23 Oct 21, 2022
LIAO Shuiying 6 Dec 01, 2022
DirectVoxGO reconstructs a scene representation from a set of calibrated images capturing the scene.

DirectVoxGO reconstructs a scene representation from a set of calibrated images capturing the scene. We achieve NeRF-comparable novel-view synthesis quality with super-fast convergence.

sunset 709 Dec 31, 2022
ADB-IP-ROTATION - Use your mobile phone to gain a temporary IP address using ADB and data tethering

ADB IP ROTATE This an Python script based on Android Debug Bridge (adb) shell sc

Dor Bismuth 2 Jul 12, 2022
Context-Aware Image Matting for Simultaneous Foreground and Alpha Estimation

Context-Aware Image Matting for Simultaneous Foreground and Alpha Estimation This is the inference codes of Context-Aware Image Matting for Simultaneo

Qiqi Hou 125 Oct 22, 2022
Python implementation of "Multi-Instance Pose Networks: Rethinking Top-Down Pose Estimation"

MIPNet: Multi-Instance Pose Networks This repository is the official pytorch python implementation of "Multi-Instance Pose Networks: Rethinking Top-Do

Rawal Khirodkar 57 Dec 12, 2022
Scalable Optical Flow-based Image Montaging and Alignment

SOFIMA SOFIMA (Scalable Optical Flow-based Image Montaging and Alignment) is a tool for stitching, aligning and warping large 2d, 3d and 4d microscopy

Google Research 16 Dec 21, 2022
imbalanced-DL: Deep Imbalanced Learning in Python

imbalanced-DL: Deep Imbalanced Learning in Python Overview imbalanced-DL (imported as imbalanceddl) is a Python package designed to make deep imbalanc

NTUCSIE CLLab 19 Dec 28, 2022
Machine Learning From Scratch. Bare bones NumPy implementations of machine learning models and algorithms with a focus on accessibility. Aims to cover everything from linear regression to deep learning.

Machine Learning From Scratch About Python implementations of some of the fundamental Machine Learning models and algorithms from scratch. The purpose

Erik Linder-Norén 21.8k Jan 09, 2023
Robot Servers and Server Manager software for robo-gym

robo-gym-server-modules Robot Servers and Server Manager software for robo-gym. For info on how to use this package please visit the robo-gym website

JR ROBOTICS 4 Aug 16, 2021
University of Rochester 2021 Summer REU focusing on music sentiment transfer using CycleGAN

Music-Sentiment-Transfer University of Rochester 2021 Summer REU focusing on music sentiment transfer using CycleGAN Poster: Music Sentiment Transfer

Miles Sigel 2 Jan 24, 2022