{"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/towards-diverse-and-faithful-one-shot","title":"Towards Diverse and Faithful One-shot Adaption of Generative Adversarial Networks","arxiv_id":"2207.08736","date":"2022-07-18","proceeding":null,"authors":["Yabo Zhang","Mingshuai Yao","Yuxiang Wei","Zhilong Ji","Jinfeng Bai","WangMeng Zuo"],"abstract":"One-shot generative domain adaption aims to transfer a pre-trained generator on one domain to a new domain using one reference image only. However, it remains very challenging for the adapted generator (i) to generate diverse images inherited from the pre-trained generator while (ii) faithfully acquiring the domain-specific attributes and styles of the reference image. In this paper, we present a novel one-shot generative domain adaption method, i.e., DiFa, for diverse generation and faithful adaptation. For global-level adaptation, we leverage the difference between the CLIP embedding of reference image and the mean embedding of source images to constrain the target generator. For local-level adaptation, we introduce an attentive style loss which aligns each intermediate token of adapted image with its corresponding token of the reference image. To facilitate diverse generation, selective cross-domain consistency is introduced to select and retain the domain-sharing attributes in the editing latent $\\mathcal{W}+$ space to inherit the diversity of pre-trained generator. Extensive experiments show that our method outperforms the state-of-the-arts both quantitatively and qualitatively, especially for the cases of large domain gaps. Moreover, our DiFa can easily be extended to zero-shot generative domain adaption with appealing results. Code is available at https://github.com/1170300521/DiFa.","url_abs":"https://arxiv.org/abs/2207.08736v2","url_pdf":"https://arxiv.org/pdf/2207.08736v2.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":"towards-diverse-and-faithful-one-shot","repo_url":"https://github.com/1170300521/DiFa","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"domain-adaptation","task_name":"Domain Adaptation"}],"methods":[{"method_slug":"clip","method_name":"CLIP"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2207.08736","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.08736"}},"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":"deterministic:regex_extraction","url":"https://github.com/1170300521/DiFa","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran_violates":1,"unverified":3},"by_repo_kind":{"official":{"samples":5,"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":"29b9a890f149a3a6","entry":"get_keys","repo":"1170300521/DiFa","repo_kind":"official","path":"ZSSGAN/model/psp.py","file_url":"https://github.com/1170300521/DiFa/blob/HEAD/ZSSGAN/model/psp.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"29b9a890f149a3a6"}},{"code_sha256_prefix":"6f65e378a4313f87","entry":"make_kernel","repo":"1170300521/DiFa","repo_kind":"official","path":"ZSSGAN/model/sg2_model.py","file_url":"https://github.com/1170300521/DiFa/blob/HEAD/ZSSGAN/model/sg2_model.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6f65e378a4313f87"}},{"code_sha256_prefix":"3a3b4e84f1ea35c7","entry":"adjust_sigmoid","repo":"1170300521/DiFa","repo_kind":"official","path":"ZSSGAN/criteria/psp_loss.py","file_url":"https://github.com/1170300521/DiFa/blob/HEAD/ZSSGAN/criteria/psp_loss.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":"3a3b4e84f1ea35c7"}},{"code_sha256_prefix":"c8a3d94bda16bb05","entry":"get_avg_image","repo":"1170300521/DiFa","repo_kind":"official","path":"ZSSGAN/inference.py","file_url":"https://github.com/1170300521/DiFa/blob/HEAD/ZSSGAN/inference.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":"c8a3d94bda16bb05"}},{"code_sha256_prefix":"0e7dc2426faf9c81","entry":"run_alignment","repo":"1170300521/DiFa","repo_kind":"official","path":"ZSSGAN/inference.py","file_url":"https://github.com/1170300521/DiFa/blob/HEAD/ZSSGAN/inference.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":"0e7dc2426faf9c81"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}