From 873e94c50fca8955bf89640a527f4e26d5b673ae Mon Sep 17 00:00:00 2001 From: AnXiang Date: Fri, 19 Mar 2021 12:36:15 +0800 Subject: [PATCH] Update README.md --- recognition/arcface_torch/README.md | 17 ++++++++++++----- recognition/arcface_torch/backbones/__init__.py | 2 +- recognition/arcface_torch/backbones/iresnet.py | 8 +++++++- recognition/arcface_torch/train.py | 1 - 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/recognition/arcface_torch/README.md b/recognition/arcface_torch/README.md index 36dca4700..5d26018b2 100644 --- a/recognition/arcface_torch/README.md +++ b/recognition/arcface_torch/README.md @@ -81,21 +81,28 @@ All Model Can be found in here. ### MS1MV3 | Datasets | log | backbone | IJBC(1e-05) | IJBC(1e-04) |agedb30|cfp_fp|lfw | | :---: | :--- | :--- | :--- | :--- |:--- |:--- |:--- | -| MS1MV3-Arcface |[log](https://raw.githubusercontent.com/anxiangsir/insightface_arcface_log/master/ms1mv3_arcface_r18/training.log) | r18 | 92.08 | 94.68 | 97.65 | 97.63 | 99.73 | -| MS1MV3-Arcface |[log](https://raw.githubusercontent.com/anxiangsir/insightface_arcface_log/master/ms1mv3_arcface_r34/training.log) | r34 | 94.13 | 95.98 | 98.05 | 98.60 | 99.80 | -| MS1MV3-Arcface |[log](https://raw.githubusercontent.com/anxiangsir/insightface_arcface_log/master/ms1mv3_arcface_r50/training.log) | r50 | 94.79 | 96.43 | 98.28 | 98.89 | 99.85 | -| MS1MV3-Arcface |[log](https://raw.githubusercontent.com/anxiangsir/insightface_arcface_log/master/ms1mv3_arcface_r50_fp16/training.log) | r50-fp16 | 94.72 | 96.41 | 98.30 | 99.06 | 99.85 | -| MS1MV3-Arcface |[log](https://raw.githubusercontent.com/anxiangsir/insightface_arcface_log/master/ms1mv3_arcface_r100/training.log) | r100 | 95.22 | 96.87 | 98.45 | 99.19 | 99.85 | +| MS1MV3-Arcface |[log](https://raw.githubusercontent.com/anxiangsir/insightface_arcface_log/master/ms1mv3_arcface_r18_fp16/training.log) | r18-fp16 | 92.07 | 94.66 | 97.77 | 97.73 | 99.77 | +| MS1MV3-Arcface |[log](https://raw.githubusercontent.com/anxiangsir/insightface_arcface_log/master/ms1mv3_arcface_r34_fp16/training.log) | r34-fp16 | 94.10 | 95.90 | 98.10 | 98.67 | 99.80 | +| MS1MV3-Arcface |[log](https://raw.githubusercontent.com/anxiangsir/insightface_arcface_log/master/ms1mv3_arcface_r50_fp16/training.log) | r50-fp16 | 94.79 | 96.46 | 98.35 | 98.96 | 99.83 | +| MS1MV3-Arcface |[log](https://raw.githubusercontent.com/anxiangsir/insightface_arcface_log/master/ms1mv3_arcface_r100_fp16/training.log) | r100-fp16 | 95.31 | 96.81 | 98.48 | 99.06 | 99.85 | ### Glint360k | Datasets | log |backbone | IJBC(1e-05) | IJBC(1e-04) |agedb30|cfp_fp|lfw | | :---: | :--- |:--- | :--- | :--- |:--- |:--- |:--- | | Glint360k-Cosface |[log](https://raw.githubusercontent.com/anxiangsir/insightface_arcface_log/master/glint360k_cosface_r100/training.log) |r100 | 96.19 | 97.39 | 98.52 | 99.26 | 99.83 | | Glint360k-Cosface |[log](https://raw.githubusercontent.com/anxiangsir/insightface_arcface_log/master/glint360k_cosface_r100_fp16_0.1/training.log)|r100-fp16-sample-0.1 | 95.95 | 97.35 | 98.57 | 99.30 | 99.85 | +| Glint360k-Cosface | - | - | - | - | - | - | - | +| Glint360k-Cosface | - | - | - | - | - | - | - | +| Glint360k-Cosface | - | - | - | - | - | - | - | + + + More details see [eval.md](docs/modelzoo.md) in docs. +## Test +We test on PyTorch versions 1.6.0, 1.7.1, and 1.8.0. Please create an issue if you are having trouble. ## Citation ``` diff --git a/recognition/arcface_torch/backbones/__init__.py b/recognition/arcface_torch/backbones/__init__.py index 97e7c54a3..4a0bcbf8e 100644 --- a/recognition/arcface_torch/backbones/__init__.py +++ b/recognition/arcface_torch/backbones/__init__.py @@ -1 +1 @@ -from .iresnet import iresnet18, iresnet34, iresnet50, iresnet100 +from .iresnet import iresnet18, iresnet34, iresnet50, iresnet100, iresnet200 diff --git a/recognition/arcface_torch/backbones/iresnet.py b/recognition/arcface_torch/backbones/iresnet.py index 7aafdfdbd..c6d3b9c24 100644 --- a/recognition/arcface_torch/backbones/iresnet.py +++ b/recognition/arcface_torch/backbones/iresnet.py @@ -1,7 +1,7 @@ import torch from torch import nn -__all__ = ['iresnet18', 'iresnet34', 'iresnet50', 'iresnet100'] +__all__ = ['iresnet18', 'iresnet34', 'iresnet50', 'iresnet100', 'iresnet200'] def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): @@ -179,3 +179,9 @@ def iresnet50(pretrained=False, progress=True, **kwargs): def iresnet100(pretrained=False, progress=True, **kwargs): return _iresnet('iresnet100', IBasicBlock, [3, 13, 30, 3], pretrained, progress, **kwargs) + + +def iresnet200(pretrained=False, progress=True, **kwargs): + return _iresnet('iresnet200', IBasicBlock, [6, 26, 60, 6], pretrained, + progress, **kwargs) + diff --git a/recognition/arcface_torch/train.py b/recognition/arcface_torch/train.py index 73685fd52..bf84e6c98 100644 --- a/recognition/arcface_torch/train.py +++ b/recognition/arcface_torch/train.py @@ -97,7 +97,6 @@ def main(args): global_step += 1 features = F.normalize(backbone(img)) x_grad, loss_v = module_partial_fc.forward_backward(label, features, opt_pfc) - if cfg.fp16: features.backward(grad_scaler.scale(x_grad)) grad_scaler.unscale_(opt_backbone)