{"id":13635110,"url":"https://github.com/apple/ml-facelit","last_synced_at":"2025-04-05T18:08:38.852Z","repository":{"id":153444815,"uuid":"623202602","full_name":"apple/ml-facelit","owner":"apple","description":"Official repository of FaceLit: Neural 3D Relightable Faces (CVPR 2023)","archived":false,"fork":false,"pushed_at":"2023-07-05T22:33:13.000Z","size":37279,"stargazers_count":482,"open_issues_count":0,"forks_count":42,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-03-29T17:07:56.174Z","etag":null,"topics":["faces","gan","generative","nerf"],"latest_commit_sha":null,"homepage":"https://machinelearning.apple.com/research/neural-3d-relightable","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apple.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-03T22:47:29.000Z","updated_at":"2025-03-07T00:19:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"5cedcc16-1cf0-449a-bd4b-6deea9e5f655","html_url":"https://github.com/apple/ml-facelit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fml-facelit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fml-facelit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fml-facelit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fml-facelit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apple","download_url":"https://codeload.github.com/apple/ml-facelit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378144,"owners_count":20929296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["faces","gan","generative","nerf"],"created_at":"2024-08-02T00:00:40.834Z","updated_at":"2025-04-05T18:08:38.831Z","avatar_url":"https://github.com/apple.png","language":"Python","readme":"# FaceLit: Neural 3D Relightable Faces\n\nThis is the official repository of\n\n*Anurag Ranjan, Kwang Moo Yi, Rick Chang, Oncel Tuzel*, **FaceLit: Neural 3D Relightable Faces.** CVPR 2023\n\n[![arxiv](https://shields.io/badge/paper-green?logo=arxiv\u0026style=for-the-badge)](https://arxiv.org/abs/2303.15437)\n[![webpage](https://shields.io/badge/Webpage-green?logo=safari\u0026style=for-the-badge)](https://machinelearning.apple.com/research/neural-3d-relightable)\n\n\nhttps://user-images.githubusercontent.com/14334441/229917229-ab587c29-7250-46ab-9f42-12b52bb141de.mp4\n\n\n## Setup\n```bash\nconda create -f facelit/enviroment.yml\nconda activate facelit\n```\n\n## Demo\n\nDownload pretrained models\n\n```bash\nbash download_models.sh\n```\n\nGenerate video demos.\n\n```bash\npython 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]\n```\n\n## Training\n\nTrain with a neural rendering resolution of 64x64\n```bash\npython 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\n```\n\nFine tune with a neural rendering resolution of 128x128\n```bash\npython 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\n```\n\n## Data Preprocessing\nWe use the dataset from [EG3D](https://github.com/NVlabs/eg3d) and obtain camera parameters and illumination parameters using [DECA](https://github.com/yfeng95/DECA).\n\n#### Setting up DECA\n\n```bash\ngit clone https://github.com/YadiraF/DECA.git\ncd DECA\ngit checkout 022ed52\nbash install_conda.sh\nconda activate deca-env\nbash fetch_data.sh\n```\n\nApply our patch\n\n```bash\ngit apply FACELIT_DIR/third_party/deca.patch\n```\n\nTo generate deca fits, run `generate_deca_fits.sh`.\n\n\n## Evaluation\n\nEvaluation of models requires setting up DECA ([see here](####Setting-up-DECA)) and setting up Deep3DFaceRecon (see below).\n\n#### Setting up Deep3DFaceRecon\nUse this [fork](https://github.com/Xiaoming-Zhao/Deep3DFaceRecon_pytorch) to set up Deep3DFaceRecon_pytorch.\n```bash\ngit clone https://github.com/Xiaoming-Zhao/Deep3DFaceRecon_pytorch\n```\n \nTo run the evaluation, run `eval_metrics.sh`. Note that due to randomness in the generation process, the metrics reported might vary by  ±2%.\n\n## Citation\n\n```\n@inproceedings{ranjan2023,\n  author = {Anurag Ranjan and Kwang Moo Yi and Rick Chang and Oncel Tuzel},\n  title = {FaceLit: Neural 3D Relightable Faces},\n  booktitle = {Proceedings of the IEEE conference on computer vision and pattern recognition},\n  year = {2023}\n}\n```\n\n## Acknowledgements\n\nThis code is based on [EG3D](https://github.com/NVlabs/eg3d), we thank the authors for their github contribution. We also use portions of the code from  [GMPI](https://github.com/apple/ml-gmpi).\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapple%2Fml-facelit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapple%2Fml-facelit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapple%2Fml-facelit/lists"}