{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/a-shading-guided-generative-implicit-model","title":"A Shading-Guided Generative Implicit Model for Shape-Accurate 3D-Aware Image Synthesis","arxiv_id":"2110.15678","date":"2021-10-29","proceeding":"NeurIPS 2021 12","authors":["Xingang Pan","Xudong Xu","Chen Change Loy","Christian Theobalt","Bo Dai"],"abstract":"The advancement of generative radiance fields has pushed the boundary of 3D-aware image synthesis. Motivated by the observation that a 3D object should look realistic from multiple viewpoints, these methods introduce a multi-view constraint as regularization to learn valid 3D radiance fields from 2D images. Despite the progress, they often fall short of capturing accurate 3D shapes due to the shape-color ambiguity, limiting their applicability in downstream tasks. In this work, we address this ambiguity by proposing a novel shading-guided generative implicit model that is able to learn a starkly improved shape representation. Our key insight is that an accurate 3D shape should also yield a realistic rendering under different lighting conditions. This multi-lighting constraint is realized by modeling illumination explicitly and performing shading with various lighting conditions. Gradients are derived by feeding the synthesized images to a discriminator. To compensate for the additional computational burden of calculating surface normals, we further devise an efficient volume rendering strategy via surface tracking, reducing the training and inference time by 24% and 48%, respectively. Our experiments on multiple datasets show that the proposed approach achieves photorealistic 3D-aware image synthesis while capturing accurate underlying 3D shapes. We demonstrate improved performance of our approach on 3D shape reconstruction against existing methods, and show its applicability on image relighting. Our code will be released at https://github.com/XingangPan/ShadeGAN.","url_abs":"https://arxiv.org/abs/2110.15678v3","url_pdf":"https://arxiv.org/pdf/2110.15678v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"a-shading-guided-generative-implicit-model","repo_url":"https://github.com/xingangpan/shadegan","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"3d-shape-reconstruction","task_name":"3D Shape Reconstruction"},{"task_slug":"3d-aware-image-synthesis","task_name":"3D-Aware Image Synthesis"},{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"image-relighting","task_name":"Image Relighting"},{"task_slug":null,"task_name":"valid"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2110.15678","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2110.15678"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/xingangpan/shadegan","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran":1,"unverified":13},"by_repo_kind":{"official":{"samples":15,"ran":2,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"29e5e72bcd006dcd","entry":"spatial_average","repo":"xingangpan/shadegan","repo_kind":"official","path":"lpips/networks_basic.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/lpips/networks_basic.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"29e5e72bcd006dcd"}},{"code_sha256_prefix":"351677a36e1961df","entry":"upsample","repo":"xingangpan/shadegan","repo_kind":"official","path":"lpips/networks_basic.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/lpips/networks_basic.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"351677a36e1961df"}},{"code_sha256_prefix":"306b4b17e95e50e5","entry":"create_samples","repo":"xingangpan/shadegan","repo_kind":"official","path":"extract_shapes.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/extract_shapes.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"306b4b17e95e50e5"}},{"code_sha256_prefix":"a551faf28fc86a9f","entry":"get_current_step","repo":"xingangpan/shadegan","repo_kind":"official","path":"curriculums.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/curriculums.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a551faf28fc86a9f"}},{"code_sha256_prefix":"df709247c665b337","entry":"get_dataset","repo":"xingangpan/shadegan","repo_kind":"official","path":"datasets.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/datasets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"df709247c665b337"}},{"code_sha256_prefix":"99cf38950bfe4017","entry":"get_dataset_distributed","repo":"xingangpan/shadegan","repo_kind":"official","path":"datasets.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/datasets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"99cf38950bfe4017"}},{"code_sha256_prefix":"9a90a24d56749586","entry":"get_grid","repo":"xingangpan/shadegan","repo_kind":"official","path":"inversion.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/inversion.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9a90a24d56749586"}},{"code_sha256_prefix":"31312e8e88c4d95c","entry":"last_upsample_step","repo":"xingangpan/shadegan","repo_kind":"official","path":"curriculums.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/curriculums.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"31312e8e88c4d95c"}},{"code_sha256_prefix":"b3cb093d06a4dbf6","entry":"load_image","repo":"xingangpan/shadegan","repo_kind":"official","path":"inversion.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/inversion.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b3cb093d06a4dbf6"}},{"code_sha256_prefix":"738ade559b76771c","entry":"next_upsample_step","repo":"xingangpan/shadegan","repo_kind":"official","path":"curriculums.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/curriculums.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"738ade559b76771c"}},{"code_sha256_prefix":"11342c357ef0da98","entry":"rotate_normal","repo":"xingangpan/shadegan","repo_kind":"official","path":"inversion.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/inversion.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"11342c357ef0da98"}},{"code_sha256_prefix":"eeb9c75831e39214","entry":"sample_generator","repo":"xingangpan/shadegan","repo_kind":"official","path":"extract_shapes.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/extract_shapes.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"eeb9c75831e39214"}},{"code_sha256_prefix":"514dd3c0eee3691c","entry":"score_2afc_dataset","repo":"xingangpan/shadegan","repo_kind":"official","path":"lpips/dist_model.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/lpips/dist_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"514dd3c0eee3691c"}},{"code_sha256_prefix":"581c80d602289d6d","entry":"score_jnd_dataset","repo":"xingangpan/shadegan","repo_kind":"official","path":"lpips/dist_model.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/lpips/dist_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"581c80d602289d6d"}},{"code_sha256_prefix":"887298f852639adb","entry":"setup_evaluation","repo":"xingangpan/shadegan","repo_kind":"official","path":"fid_evaluation.py","file_url":"https://github.com/xingangpan/shadegan/blob/HEAD/fid_evaluation.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"887298f852639adb"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}