DCFace: 用双条件扩散模型生成合成人脸。CVPR 2023.4
code:mk-minchul/dcface (github.com)
paper:[2304.07060] DCFace: Synthetic Face Generation with Dual Condition Diffusion Model (arxiv.org)
应用:生成用于训练人脸识别模型的合成数据集。
背景:生成合成数据集需要考虑多个因素,如姿势、光照、表情、年龄和遮挡等,以模拟真实图像的条件分布。以往的研究主要使用GAN或3D模型生成合成数据集。
方法:本文提出一种基于扩散模型的双重条件人脸生成器(DCFace),通过结合主体外观(ID)和外部因素(风格)条件来控制类内和类间变化。作者使用了新颖的Patch-wise风格提取器和Time-step依赖的ID损失,使DCFace能够在不同风格下精确控制同一主体的人脸图像生成。
结果:使用DCFace生成的合成数据集训练的人脸识别模型在LFW、CFP-FP、CPLFW、AgeDB和CALFW等5个测试数据集中,平均比以前的方法提高了6.11%的验证准确性。
问题1:No models "dcface/dcface/pretrained_models/adaface_ir101_webface4m.ckpt'
Traceback (most recent call last):
File "/data/dcface/dcface/src/recognition/recognition_helper.py", line 53, in download_ir_pretrained_statedict
subprocess.check_call([os.path.expanduser('/opt/conda/envs/dcface/lib/python3.7/site-packages/gdown'), '--id', _id])
File "/opt/conda/envs/dcface/lib/python3.7/subprocess.py", line 358, in check_call
retcode = call(*popenargs, **kwargs)
File "/opt/conda/envs/dcface/lib/python3.7/subprocess.py", line 339, in call
with Popen(*popenargs, **kwargs) as p:
File "/opt/conda/envs/dcface/lib/python3.7/subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "/opt/conda/envs/dcface/lib/python3.7/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/opt/conda/envs/dcface/lib/python3.7/site-packages/gdown'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "synthesis.py", line 140, in
main()
File "synthesis.py", line 77, in main
pl_module: LightningModule = hydra.utils.instantiate(model_hparam)()
File "/data/dcface/dcface/src/trainer.py", line 57, in __init__
self.recognition_model_eval: RecognitionModel = make_recognition_model(self.hparams.recognition_eval)
File "/data/dcface/dcface/src/recognition/recognition_helper.py", line 264, in make_recognition_model
model_statedict = download_ir_pretrained_statedict(backbone_name, 'webface4m', 'adaface')
File "/data/dcface/dcface/src/recognition/recognition_helper.py", line 56, in download_ir_pretrained_statedict
subprocess.check_call([os.path.expanduser('/opt/conda/envs/dcface/lib/python3.7/site-packages/gdown'), '--id', _id])
File "/opt/conda/envs/dcface/lib/python3.7/subprocess.py", line 358, in check_call
retcode = call(*popenargs, **kwargs)
File "/opt/conda/envs/dcface/lib/python3.7/subprocess.py", line 339, in call
with Popen(*popenargs, **kwargs) as p:
File "/opt/conda/envs/dcface/lib/python3.7/subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "/opt/conda/envs/dcface/lib/python3.7/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/opt/conda/envs/dcface/lib/python3.7/site-packages/gdown'
报错没直接报缺少文件,而是一个包gdown的问题,解决的方向就错了,print了一下发现是因为checkpoint_path的文件缺失,发现缺失的权重作者没给出,搜索后在作者的另一个项目里找到了:
参考:mk-minchul/AdaFace (github.com)
Google 云端硬盘 - 病毒扫描警告
id_image:
style_image:
generated_images:
to be released
dcface datasets:https://github.com/mk-minchul/dcface?tab=readme-ov-file#dataset-release