jdai-cv / facex-zoo Goto Github PK
View Code? Open in Web Editor NEWA PyTorch Toolbox for Face Recognition
Home Page: https://arxiv.org/pdf/2101.04407.pdf
License: Other
A PyTorch Toolbox for Face Recognition
Home Page: https://arxiv.org/pdf/2101.04407.pdf
License: Other
i downloaded the pretrained model Attention-92(MX) and the LFW acc announced as 99.82% but as i used the test_lfw.py to get the result , only 85.9% accuracy achieved.
the log is below:
backbone param:
{'stage1_modules': 1, 'stage2_modules': 2, 'stage3_modules': 3, 'feat_dim': 512, 'out_h': 7, 'out_w': 7}
100%|██████████| 828/828 [06:51<00:00, 2.26it/s]
6000it [00:00, 22128.20it/s]
+-------------+---------------+----------------------+
| model_name | mean accuracy | standard error |
+-------------+---------------+----------------------+
| Epoch_17.pt | 0.859 | 0.007375300789011594 |
+-------------+---------------+----------------------+
Process finished with exit code 0
any idea about it ?
In the project I can not find the code for cropping aligned image, how to do that? Thank you.
when i use the 'Mv-softmax' as head to train a model,i met the problem:'one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [64, 10575]], which is output 0 of MmBackward, is at version 3; expected version 0 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).'how can i solve the problem? thank you
This is a great repo, thanks for sharing.
I have some problems here. I want to make some new mask UV texture map templates for myself. Could you please provide the uv_mask.png and process scripts? thank you.
Hi. @wang21jun . Thank for your contribute.
I have a question about the model using for recognition, I saw many pretrain model in https://github.com/JDAI-CV/FaceX-Zoo/tree/main/training_mode but I dont know what model you used ? . In config file I saw this model name is face_recognition_1.0 but I dont know the architecture of this model ( backbone, head v..v). Can you share me the details of this model ?
Thanks.
I use my dataset for training.There is a probelm.
Traceback (most recent call last):
File "train.py", line 186, in
train(args)
File "train.py", line 130, in train
prototype, optimizer, criterion, epoch, conf, loss_meter)
File "train.py", line 69, in train_one_epoch
images1_probe = probe_net(images1)
File "/home/dl/dyj/venv37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/dl/dyj/venv37/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 152, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File "/home/dl/dyj/venv37/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 162, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File "/home/dl/dyj/venv37/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 85, in parallel_apply
output.reraise()
File "/home/dl/dyj/venv37/lib/python3.7/site-packages/torch/_utils.py", line 394, in reraise
raise self.exc_type(msg)
ValueError: Caught ValueError in replica 0 on device 0.
Original Traceback (most recent call last):
File "/home/dl/dyj/venv37/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 60, in _worker
output = module(*input, **kwargs)
File "/home/dl/dyj/venv37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "../../backbone/MobileFaceNets.py", line 102, in forward
out = self.conv_6_dw(out)
File "/home/dl/dyj/venv37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "../../backbone/MobileFaceNets.py", line 41, in forward
x = self.bn(x)
File "/home/dl/dyj/venv37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/dl/dyj/venv37/lib/python3.7/site-packages/torch/nn/modules/batchnorm.py", line 107, in forward
exponential_average_factor, self.eps)
File "/home/dl/dyj/venv37/lib/python3.7/site-packages/torch/nn/functional.py", line 1666, in batch_norm
raise ValueError('Expected more than 1 value per channel when training, got input size {}'.format(size))
ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 512, 1, 1])
Hi @wang21jun ,
Thanks for your contributor!
In your submit at https://github.com/JDAI-CV/FaceX-Zoo/tree/main/training_mode, i see you had two kind models: SOTA backbones model and SOTA heads model. What is the difference between them?
Thank you!!
It seems that there is no live estimation framework yet.Will the live estimation be added in the future?
我有一些小人脸要识别身份,最小的是18X18,是运行face_detect.py进行人脸识别吗?我运行后他说识别失败,人脸都框不出来,更别提后续的训练了,想问一下他可不可以识别小人脸,还是说我需要调整一些参数。英语不好对着谷歌浏览器的翻译看了一下没怎么明白,来请教一下
Can I support parallel processing and run multiple faces on the GPU each time?
I found that the detection takes a long time and real-time performance cannot be guaranteed. Can I still optimize it?
FaceX-Zoo/test_protocol/lfw/pairs_parser.py
Lines 30 to 40 in 5f8d64a
line 36:
When test on lfw, this line is right.
But if test on rfw, it makes pair number 6000 --> 5999.
Does it support fine tuning
pytorch 1.6.0
torchvision 0.7.0
Hi,
Thank you for your great work!
In https://github.com/JDAI-CV/FaceX-Zoo/blob/main/training_mode/README.md, what backbone is used in Experiments of SOTA heads, Shallow Face Learning and Masked Face Recognition?
Best regards.
建议将训练数据存储成一个压缩包类似rec或lmdb,数据量大的时候图片压缩搬移不方便😄
Hello!
Thank you for very extensive research of face recognition methods!
I have a few questions regarding masked experiments:
when i ran add_mask_one.py, i met this problem, how to solve this issue? Right now, i am trying to rerun the whole project, can you offer an more detailed instruction? Thank you so much
In training, you just provided a source script of InsightFace about face_align. Could you please provide more info about this?
And if I want to train on MS-Celeb-1M-v1c. Should I do this alignment?
Thanks.
Hi @wang21jun ,
I want to replace reduce_l2 to reduce_mean in resnet model and retrain.
How can i solve it?
使用3.1 Experiments of SOTA backbones下的模型时,发现有些模型可以加载成功有些会报错
我的pytorch为1.1.0 GPU版本
按照如下方式加载MobileFaceNet模型成功
model = MobileFaceNet(512, 7, 7)
model = nn.DataParallel(model)
model.load_state_dict(torch.load(‘model.pt', False)
但是按照同样方式加载Resnet50-ir模型报错“invalid load key, '\xff'.”
model = Resnet(152, 0.4)
model = nn.DataParallel(model)
model.load_state_dict(torch.load(‘model.pt’, False)
请问一下要怎么样才能正确加载Resnet50-ir模型?
Hi
Thank you for this wonderful open source module. Regarding the similarity score for face recognition, what is the optimal baseline/benchmark which we should consider while making comparisons between two faces?
Also, would it be possible to derive a similarity percentage between 0 - 100%? Is the similarity score scale linear?
head_conf.yaml中的num_class目前都是72778, 想要在预训练模型的基础上使用自定义人脸数据集继续训练,需要将head_conf.yaml文件中的num_class改成自定义人脸数据集中的数量吗?
请问如何reconstruct 口罩的uv texture map?我有一些自己找的口罩图片极其mask,请问我该如何得到对应的texture?或者我想给人脸增加新的饰品,如眼睛,耳机等,应该如何获取对应物体的mask,以及uv_mask?
@wang21jun Hello,
I have a small question, In this project you used cosine similarity for caculate score between 2 feature. This score can be negative so I wanna normalize it between 0 and 1. Can you share the solution to do it ?
Thanks
Hi authors,
Thanks so much for your work, which helps me a lot for constructing a complete custom face recognition training pipeline.
I want to ask about the evaluation on AgeDB dataset, since the link you displayed on the page (https://ibug.doc.ic.ac.uk/resources/agedb/) only includes the pictures while the pair list files & landmark files are missing. So I wonder if you can upload the missing files, which I woud be very grateful.
BTW, have you tried CFP_FP dataset as one of the verification sets? It seems that there are only .rec files for MXNet framework available online but I have seen a lot of papers that includes this dataset as a metric, just like LFW and AgeDB.
I think this kind of codes are very useful for me to analyzing my data. Thanks very much.
发现测试模块只有对各种指标的评估,如果想直接两张进行比对,请问如何做呢?
1.在这个工具箱中,具有一个3d的添加口罩的操作,这个作用是为了训练口罩人脸识别产生数据集,在这个工具箱中,有专门为口罩人脸识别训练好的模型吗?还是用之前的检测识别模型 只不过使用产生口罩的数据进行测试??这部分我目前还没有找到
Masked Face Recognition 的指标是出自这个数据集的测试吗?
https://github.com/X-zhangyang/Real-World-Masked-Face-Dataset
Hi,
I like to test face_pipline.py on cpu, but I keep taking the following error:
RuntimeError: module must have its parameters and buffers on device cuda:0 (device_ids[0]) but found one of them on device: cpu
However, I changed the device to CPU.
where is the AttentionNet?
thanks for the effort to the project . in the report the words below are mentioned:
we synthesize the masked fa-
cial datasets based on MegaFace by using FMA-3D, named
MegaFace-mask, which contains the masked probe images
and remains the gallery images non-masked. As shown
in Figure 7,
so is the masked face recognition dataset available for download ? or any details of generating the dataset can be provided ?
从王神的回答看,circleloss实现貌似有问题,麻烦确认下
https://www.zhihu.com/question/382802283/answer/1114719159
D:\workspace\FaceX-Zoo\addition_module\face_mask_adding\FMA-3D>python add_mask_one.py
Traceback (most recent call last):
File "add_mask_one.py", line 1, in
from face_masker import FaceMasker
File "D:\workspace\FaceX-Zoo\addition_module\face_mask_adding\FMA-3D\face_masker.py", line 10, in
from utils import mesh
File "D:\workspace\FaceX-Zoo\addition_module\face_mask_adding\FMA-3D\utils\mesh_init_.py", line 1, in
from . import render
File "D:\workspace\FaceX-Zoo\addition_module\face_mask_adding\FMA-3D\utils\mesh\render.py", line 22, in
from . import mesh_core_cython
ImportError: cannot import name 'mesh_core_cython' from partially initialized module 'utils.mesh' (most likely due to a circular import) (D:\workspace\FaceX-Zoo\addition_module\face_mask_adding\FMA-3D\utils\mesh_init_.py)
i have downloaded the pretrained model : Attention-92(MX)
but how to use it .
I have tried the following code:
model = ResidualAttentionNet(1, 1, 1, 512, 7, 7) model.load_state_dict(torch.load("/home/leo/workspace/pretrained/Attention92/Epoch_17.pt"))
and it failed with the error below:
{RuntimeError}Error(s) in loading state_dict for ResidualAttentionNet: Missing key(s) in state_dict: "conv1.0.weight", "conv1.1.weight", "conv1.1.bias", "conv1.1.running_mean", "conv1.1.running_var", "attention_body.0.bn1.weight", "attention_body.0.bn1.bias", "attention_body.0.bn1.running_mean", "attention_body.0.bn1.running_var", "attention_body.0.conv1.weight", "attention_body.0.bn2.weight", "attention_body.0.bn2.bias", "attention_body.0.bn2.running_mean", "attention_body.0.bn2.running_var", "attention_body.0.conv2.weight", "attention_body.0.bn3.weight", "attention_body.0.bn3.bias", "attention_body.0.bn3.running_mean", "attention_body.0.bn3.running_var", "attention_body.0.conv3.weight", "attention_body.0.conv4.weight", "attention_body.1.first_residual_blocks.bn1.weight", "attention_body.1.first_residual_blocks.bn1.bias", "attention_body.1.first_residual_blocks.bn1.running_mean", "attention_body.1.first_residual_blocks.bn1.running_var", "attention_body.1.first_residual_blocks.conv1.w...
can anyone help to solve this problem and make use of the pretrained model
感谢开源这么优秀的项目,使戴口罩人脸识别变得简单.
想请教个问题,我基于Attention92训练自己的口罩人脸,500个人,共2w张人脸数据训练结果过拟合,于是想通过预训练模型进行finetune,请问按这个思路该如何修改训练脚本?
希望可以提供宝贵的建议
谢谢!
请问:会开源3d 人脸识别相关算法吗?
谢谢
Thks for ur excellent project, and the 3d face-mask is very robust.
However, I want add more kinds of mask texture for face-mask generation but cannot found any documention about how to do this. Can u provide some information?
你好,add_mask如果一张图有两个脸的话,无法同时给两个脸加上口罩,在遍历face_lms时会把前一次加的口罩去除掉,有什么好的建议修改加载一图多脸的情况吗? 谢谢
Hi FaceX-Zoo team,
I face a warning while training: "[W IndexingUtils.h:25] Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. (function expandTensors)"
I used warnings lib of python3 but it didnt work :(?
Can you solve this problem
Hi, FaceX-Zoo Team,
Thanks for your fantastic work. I wonder how to make a recognition model (pkl file) in face_sdk folder using training_procedure. I load the pkl using torch.load
and I find it is a ParrallelModel
class. How do you make it?
Thanks!
"X" - we also aim to provide something beyond face recognition, e.g. face paring, face lightning.
should be changed to
"X" - we also aim to provide something beyond face recognition, e.g. face parsing, face lightning.
paring --> parsing
From the log attached(https://drive.google.com/drive/folders/1wR48k8h8mCryMw4NrfkBtocw_TGp2S1q?usp=sharing
), there seems to be a pretrained model, as below shows.
My concern is what mv_epoch_8.pt
is and is it fair for the benchmark.
INFO 2020-12-04 15:43:22 train.py: 178] Namespace(backbone_conf_file='../backbone_conf.yaml', backbone_type='EfficientNet', \
batch_size=512, data_root='/home/wangjun492/wj_data/faceX-Zoo/deepglint/msra_crop', epoches=18, \
head_conf_file='../head_conf.yaml', head_type='MV-Softmax', log_dir='log', lr=0.1, milestones=[10, 13, 16], momentum=0.9, \
out_dir='out_dir', pretrain_model='mv_epoch_8.pt', print_freq=200, resume=False, save_freq=3000, step='10, 13, 16', \
tensorboardx_logdir='mv-effi', train_file='/home/wangjun492/wj_data/faceX-Zoo/deepglint/msceleb_deepglint_train_file.txt', \
writer=<tensorboardX.writer.SummaryWriter object at 0x7f9ae71fce80>)
thanks, again.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.