{"id":18600813,"url":"https://github.com/autonomousvision/campari","last_synced_at":"2025-04-10T18:31:40.277Z","repository":{"id":99789943,"uuid":"454443846","full_name":"autonomousvision/campari","owner":"autonomousvision","description":"[3DV'21] CAMPARI: Camera-Aware Decomposed Generative Neural Radiance Fields","archived":false,"fork":false,"pushed_at":"2022-02-01T15:40:45.000Z","size":18031,"stargazers_count":30,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-25T03:01:37.375Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/autonomousvision.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-02-01T15:35:47.000Z","updated_at":"2024-05-23T08:34:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"83314983-46f0-4193-b115-9c0e2e295d65","html_url":"https://github.com/autonomousvision/campari","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/autonomousvision%2Fcampari","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autonomousvision%2Fcampari/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autonomousvision%2Fcampari/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autonomousvision%2Fcampari/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autonomousvision","download_url":"https://codeload.github.com/autonomousvision/campari/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248271769,"owners_count":21075800,"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":[],"created_at":"2024-11-07T02:05:43.693Z","updated_at":"2025-04-10T18:31:35.261Z","avatar_url":"https://github.com/autonomousvision.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CAMPARI: Camera-Aware Decomposed Generative Neural Radiance Fields\n## [Paper](http://www.cvlibs.net/publications/Niemeyer2021THREEDV.pdf) | [Supplementary](http://www.cvlibs.net/publications/Niemeyer2021THREEDV_supplementary.pdf) | [Video](http://www.youtube.com/watch?v=rrIIEc2qYjM\u0026vq=hd1080\u0026autoplay=1) | [Poster](http://www.cvlibs.net/publications/Niemeyer2021THREEDV_poster.pdf)\n\nIf you find our code or paper useful, please cite as\n\n    @inproceedings{CAMPARINiemeyer2021,\n        author = {Niemeyer, Michael and Geiger, Andreas},\n        title = {CAMPARI: Camera-Aware Decomposed Generative Neural Radiance Fields},\n        booktitle = {International Conference on 3D Vision (3DV)},\n        year = {2021}\n    }\n\n## TL; DR - Quick Start\n\n![Faces](vis.gif)\n\nFirst you have to make sure that you have all dependencies in place. The simplest way to do so, is to use [anaconda](https://www.anaconda.com/).\n\nYou can create an anaconda environment called `campari` using\n```\nconda env create -f environment.yml\nconda activate campari\n```\n\nYou can now test our code on the provided pre-trained models.\nFor example, for creating short video clips, run simply run\n```\npython eval_video.py configs/celeba_pretrained.yaml\n```\nor\n```\npython eval_figures.py configs/celeba_pretrained.yaml\n```\nfor creating respective figures.\n\nThis script should create a model output folder `out/celeba_pretrained`.\nThe animations are then saved to the respective subfolders.\n\n## Usage\n\n### Datasets and Stats Files\n\nTo train a model from scratch, you have to download the respective dataset.\n\nFor this, please run\n```\nbash scripts/download_dataset.sh\n```\nand following the instructions. This script should download and unpack the data automatically into the `data/` folder.\n\n\n**Note:** For FID evaluation or creating figures containing the GT camera distributions, you need to download the \"stats files\" (select \"4 - Camera stats files\" for this).\n\n\n### Controllable Image Synthesis\n\nTo render short clips or figures from a trained model, run\n```\npython eval_video.py CONFIG.yaml\n```\nor\n```\npython eval_figures.py CONFIG.yaml\n```\nwhere you replace `CONFIG.yaml` with the correct config file.\nThe easiest way is to use a pre-trained model.\nYou can do this by using one of the config files which are indicated with `*_pretrained.yaml`. \n\nFor example, for our model trained on celebA, run\n```\npython eval_video.py configs/celeba_pretrained.yaml\n```\nOur script will automatically download the model checkpoints and render images.\nYou can find the outputs in the `out/*_pretrained` folders.\n\nPlease note that the config files  `*_pretrained.yaml` are only for evaluation or rendering, not for training new models: when these configs are used for training, the model will be trained from scratch, but during inference our code will still use the pre-trained model.\n\n### FID Evaluation\nFor evaluation of the models, we provide the script `eval_fid.py`. Make sure to have downloaded the stats files (see Usage - Datasets and Stats Files). You can run it using\n```\npython eval_fid.py CONFIG.yaml\n```\nThe script generates 20000 images and calculates the FID score.\n\n### Training\nFinally, to train a new network from scratch, run\n```\npython train.py CONFIG.yaml\n```\nwhere you replace `CONFIG.yaml` with the name of the configuration file you want to use.\n\nYou can monitor on \u003chttp://localhost:6006\u003e the training process using [tensorboard](https://www.tensorflow.org/guide/summaries_and_tensorboard):\n```\ncd OUTPUT_DIR\ntensorboard --logdir ./logs\n```\nwhere you replace `OUTPUT_DIR` with the respective output directory. For available training options, please take a look at `configs/default.yaml`.\n\n# Futher Information\n\n## More Work on Coordinate-based Neural Representations\nIf you like the CAMPARI project, please check out related works on neural representions from our group:\n- [Niemeyer et. al. - GIRAFFE: Representing Scenes as Compositional Generative Neural Feature Fields (CVPR'21)](https://github.com/autonomousvision/giraffe)\n- [Schwarz et. al. - GRAF: Generative Radiance Fields for 3D-Aware Image Synthesis (NeurIPS'20)](https://github.com/autonomousvision/graf)\n- [Niemeyer et. al. - DVR: Learning Implicit 3D Representations without 3D Supervision (CVPR'20)](https://github.com/autonomousvision/differentiable_volumetric_rendering)\n- [Oechsle et. al. - Learning Implicit Surface Light Fields (3DV'20)](https://arxiv.org/abs/2003.12406)\n- [Peng et. al. - Convolutional Occupancy Networks (ECCV'20)](https://arxiv.org/abs/2003.04618)\n- [Niemeyer et. al. - Occupancy Flow: 4D Reconstruction by Learning Particle Dynamics (ICCV'19)](https://avg.is.tuebingen.mpg.de/publications/niemeyer2019iccv)\n- [Oechsle et. al. - Texture Fields: Learning Texture Representations in Function Space (ICCV'19)](https://avg.is.tuebingen.mpg.de/publications/oechsle2019iccv)\n- [Mescheder et. al. - Occupancy Networks: Learning 3D Reconstruction in Function Space (CVPR'19)](https://avg.is.tuebingen.mpg.de/publications/occupancy-networks)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautonomousvision%2Fcampari","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautonomousvision%2Fcampari","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautonomousvision%2Fcampari/lists"}