环境文件名拼写为 enviroment.yml,需确认路径与拼写;demo 与微调依赖 download_models.sh 下载的预训练模型;数据预处理和评测需额外克隆 DECA 与 Deep3DFaceRecon 并打补丁
conda create -f facelit/enviroment.yml
conda activate facelit
bash download_models.shREADME 未说明显存要求;训练命令默认使用 8 张 GPU(--gpus=8),未提及 CPU 运行或具体 GPU 型号
苹果开源的 FaceLit 实现,用神经 3D 表示生成可重打光的人脸并支持相机与光照解耦
FaceLit 是 CVPR 2023 的官方实现,用 GAN 和 NeRF 生成可重打光的三维人脸,让生成的人脸能按任意光照条件渲染。
核心能力
- 基于 EG3D 生成神经 3D 人脸表示
- 支持 diffuse 与 full 两种光照模式训练
- 可对相机、光照、高光等条件做解耦控制
- 提供预训练模型直接生成视频 demo
- 支持 64x64 训练后微调到 128x128 渲染分辨率
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
FaceLit: Neural 3D Relightable Faces
This is the official repository of
Anurag Ranjan, Kwang Moo Yi, Rick Chang, Oncel Tuzel, FaceLit: Neural 3D Relightable Faces. CVPR 2023
Setup
conda create -f facelit/enviroment.yml
conda activate facelit
Demo
Download pretrained models
bash download_models.sh
Generate video demos.
python gen_videos.py --outdir=out --trunc=0.7 --seeds=0-3 --grid=2x2 --network=pretrained/NETWORK.pkl --light_cond=True --entangle=[camera, light, lightcam, specular, specularcam]
Training
Train with a neural rendering resolution of 64x64
python train.py --outdir==out --cfg=ffhq --data=DATA_DIR --gpus=8 --batch=32 --gamma=1 --gen_pose_cond=True --gen_light_cond=True --light_mode=[diffuse, full] --normal_reg_weight=1e-4 --neural_rendering_resolution_final=64
Fine tune with a neural rendering resolution of 128x128
python train.py --outdir==out --cfg=ffhq --data=DATA_DIR --gpus=8 --batch=32 --gamma=1 --gen_pose_cond=True --gen_light_cond=True --light_mode=[diffuse, full] --normal_reg_weight=1e-4 --neural_rendering_resolution_final=128 --resume=pretrained/NETWORK.pkl
Data Preprocessing
We use the dataset from EG3D and obtain camera parameters and illumination parameters using DECA.
Setting up DECA
git clone https://github.com/YadiraF/DECA.git
cd DECA
git checkout 022ed52
bash install_conda.sh
conda activate deca-env
bash fetch_data.sh
Apply our patch
git apply FACELIT_DIR/third_party/deca.patch
To generate deca fits, run generate_deca_fits.sh.
Evaluation
Evaluation of models requires setting up DECA (see here) and setting up Deep3DFaceRecon (see below).
Setting up Deep3DFaceRecon
Use this fork to set up Deep3DFaceRecon_pytorch.
git clone https://github.com/Xiaoming-Zhao/Deep3DFaceRecon_pytorch
To run the evaluation, run eval_metrics.sh. Note that due to randomness in the generation process, the metrics reported might vary by ±2%.
Citation
@inproceedings{ranjan2023,
author = {Anurag Ranjan and Kwang Moo Yi and Rick Chang and Oncel Tuzel},
title = {FaceLit: Neural 3D Relightable Faces},
booktitle = {Proceedings of the IEEE conference on computer vision and pattern recognition},
year = {2023}
}
Acknowledgements
This code is based on EG3D, we thank the authors for their github contribution. We also use portions of the code from GMPI.