{"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/in-domain-gan-inversion-for-real-image","title":"In-Domain GAN Inversion for Real Image Editing","arxiv_id":"2004.00049","date":"2020-03-31","proceeding":"ECCV 2020 8","authors":["Jiapeng Zhu","Yujun Shen","Deli Zhao","Bolei Zhou"],"abstract":"Recent work has shown that a variety of semantics emerge in the latent space of Generative Adversarial Networks (GANs) when being trained to synthesize images. However, it is difficult to use these learned semantics for real image editing. A common practice of feeding a real image to a trained GAN generator is to invert it back to a latent code. However, existing inversion methods typically focus on reconstructing the target image by pixel values yet fail to land the inverted code in the semantic domain of the original latent space. As a result, the reconstructed image cannot well support semantic editing through varying the inverted code. To solve this problem, we propose an in-domain GAN inversion approach, which not only faithfully reconstructs the input image but also ensures the inverted code to be semantically meaningful for editing. We first learn a novel domain-guided encoder to project a given image to the native latent space of GANs. We then propose domain-regularized optimization by involving the encoder as a regularizer to fine-tune the code produced by the encoder and better recover the target image. Extensive experiments suggest that our inversion method achieves satisfying real image reconstruction and more importantly facilitates various image editing tasks, significantly outperforming start-of-the-arts.","url_abs":"https://arxiv.org/abs/2004.00049v3","url_pdf":"https://arxiv.org/pdf/2004.00049v3.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":"in-domain-gan-inversion-for-real-image","repo_url":"https://github.com/genforce/idinvert","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"in-domain-gan-inversion-for-real-image","repo_url":"https://github.com/genforce/idinvert_pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-reconstruction","task_name":"Image Reconstruction"}],"methods":[{"method_slug":"convolution","method_name":"Convolution"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2004.00049","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2004.00049"}},"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/genforce/idinvert","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/genforce/idinvert_pytorch","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran":1,"unverified":6},"by_repo_kind":{"listed":{"samples":8,"ran":2,"repositories":2}},"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":"ff0d399a0317c249","entry":"get_temp_logger","repo":"genforce/idinvert_pytorch","repo_kind":"listed","path":"models/base_module.py","file_url":"https://github.com/genforce/idinvert_pytorch/blob/HEAD/models/base_module.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ff0d399a0317c249"}},{"code_sha256_prefix":"efd5d4ab788539f4","entry":"tuple_product","repo":"genforce/idinvert","repo_kind":"listed","path":"dnnlib/util.py","file_url":"https://github.com/genforce/idinvert/blob/HEAD/dnnlib/util.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":"efd5d4ab788539f4"}},{"code_sha256_prefix":"9d31d2c4cd16bb2d","entry":"ask_yes_no","repo":"genforce/idinvert","repo_kind":"listed","path":"dnnlib/util.py","file_url":"https://github.com/genforce/idinvert/blob/HEAD/dnnlib/util.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":"9d31d2c4cd16bb2d"}},{"code_sha256_prefix":"6bc5a9d2ae904282","entry":"build_encoder","repo":"genforce/idinvert_pytorch","repo_kind":"listed","path":"models/helper.py","file_url":"https://github.com/genforce/idinvert_pytorch/blob/HEAD/models/helper.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":"6bc5a9d2ae904282"}},{"code_sha256_prefix":"01ad09c8b01d79ee","entry":"build_generator","repo":"genforce/idinvert_pytorch","repo_kind":"listed","path":"models/helper.py","file_url":"https://github.com/genforce/idinvert_pytorch/blob/HEAD/models/helper.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":"01ad09c8b01d79ee"}},{"code_sha256_prefix":"31857d2f579c1600","entry":"execute_cmdline","repo":"genforce/idinvert","repo_kind":"listed","path":"dataset_tool.py","file_url":"https://github.com/genforce/idinvert/blob/HEAD/dataset_tool.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":"31857d2f579c1600"}},{"code_sha256_prefix":"053fc534bc6bb989","entry":"format_time","repo":"genforce/idinvert","repo_kind":"listed","path":"dnnlib/util.py","file_url":"https://github.com/genforce/idinvert/blob/HEAD/dnnlib/util.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":"053fc534bc6bb989"}},{"code_sha256_prefix":"5eb9fdaa872d49a6","entry":"get_weight_path","repo":"genforce/idinvert_pytorch","repo_kind":"listed","path":"models/model_settings.py","file_url":"https://github.com/genforce/idinvert_pytorch/blob/HEAD/models/model_settings.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":"5eb9fdaa872d49a6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}