{"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/one-shot-adaptation-of-gan-in-just-one-clip","title":"One-Shot Adaptation of GAN in Just One CLIP","arxiv_id":"2203.09301","date":"2022-03-17","proceeding":null,"authors":["Gihyun Kwon","Jong Chul Ye"],"abstract":"There are many recent research efforts to fine-tune a pre-trained generator with a few target images to generate images of a novel domain. Unfortunately, these methods often suffer from overfitting or under-fitting when fine-tuned with a single target image. To address this, here we present a novel single-shot GAN adaptation method through unified CLIP space manipulations. Specifically, our model employs a two-step training strategy: reference image search in the source generator using a CLIP-guided latent optimization, followed by generator fine-tuning with a novel loss function that imposes CLIP space consistency between the source and adapted generators. To further improve the adapted model to produce spatially consistent samples with respect to the source generator, we also propose contrastive regularization for patchwise relationships in the CLIP space. Experimental results show that our model generates diverse outputs with the target texture and outperforms the baseline models both qualitatively and quantitatively. Furthermore, we show that our CLIP space manipulation strategy allows more effective attribute editing.","url_abs":"https://arxiv.org/abs/2203.09301v4","url_pdf":"https://arxiv.org/pdf/2203.09301v4.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":"one-shot-adaptation-of-gan-in-just-one-clip","repo_url":"https://github.com/anon96652/oneshotclip","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"one-shot-adaptation-of-gan-in-just-one-clip","repo_url":"https://github.com/cyclomon/oneshotclip","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"one-shot-adaptation-of-gan-in-just-one-clip","repo_url":"https://github.com/submission6378/oneshotclip","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"attribute","task_name":"Attribute"},{"task_slug":"image-retrieval","task_name":"Image Retrieval"}],"methods":[{"method_slug":"clip","method_name":"CLIP"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2203.09301","atlas_url":"https://app.syntology.ai/?focus=2203.09301","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2203.09301"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/anon96652/oneshotclip","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/cyclomon/oneshotclip","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/submission6378/oneshotclip","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":2,"ran_draft_wrong":2,"ran":5,"ran_violates":1,"unverified":6},"by_repo_kind":{"official":{"samples":16,"ran":10,"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":"6d1c134da10d0124","entry":"clip_normalize","repo":"cyclomon/oneshotclip","repo_kind":"official","path":"train_oneshot.py","file_url":"https://github.com/cyclomon/oneshotclip/blob/HEAD/train_oneshot.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6d1c134da10d0124"}},{"code_sha256_prefix":"3651db4e5ae8d189","entry":"d_logistic_loss","repo":"anon96652/oneshotclip","repo_kind":"official","path":"train_oneshot.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/train_oneshot.py","link_basis":"plan_row","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":"3651db4e5ae8d189"}},{"code_sha256_prefix":"dbb756dcd778f52f","entry":"data_sampler","repo":"anon96652/oneshotclip","repo_kind":"official","path":"train_oneshot.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/train_oneshot.py","link_basis":"plan_row","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":"dbb756dcd778f52f"}},{"code_sha256_prefix":"bd115aa43372ad6b","entry":"frechet_distance","repo":"anon96652/oneshotclip","repo_kind":"official","path":"metrics/fid.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/metrics/fid.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":"bd115aa43372ad6b"}},{"code_sha256_prefix":"380e205f2b8ababc","entry":"get_alphas","repo":"anon96652/oneshotclip","repo_kind":"official","path":"metrics/utils.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/metrics/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"380e205f2b8ababc"}},{"code_sha256_prefix":"6f65e378a4313f87","entry":"make_kernel","repo":"anon96652/oneshotclip","repo_kind":"official","path":"model.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/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":"0577f262ab8bb1d6","entry":"normalize","repo":"anon96652/oneshotclip","repo_kind":"official","path":"metrics/lpips.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/metrics/lpips.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":"0577f262ab8bb1d6"}},{"code_sha256_prefix":"3f0a1105ef251d78","entry":"reduce_sum","repo":"anon96652/oneshotclip","repo_kind":"official","path":"distributed.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/distributed.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":"3f0a1105ef251d78"}},{"code_sha256_prefix":"8b483042fac3893a","entry":"sigmoid","repo":"anon96652/oneshotclip","repo_kind":"official","path":"metrics/utils.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/metrics/utils.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":"8b483042fac3893a"}},{"code_sha256_prefix":"fe99cfd294676edb","entry":"upfirdn2d_native","repo":"anon96652/oneshotclip","repo_kind":"official","path":"op/upfirdn2d.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/op/upfirdn2d.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fe99cfd294676edb"}},{"code_sha256_prefix":"ed03ba54397adbe4","entry":"all_gather","repo":"anon96652/oneshotclip","repo_kind":"official","path":"distributed.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/distributed.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":"ed03ba54397adbe4"}},{"code_sha256_prefix":"a95e5e989a7a2519","entry":"calculate_lpips_given_images","repo":"anon96652/oneshotclip","repo_kind":"official","path":"metrics/lpips.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/metrics/lpips.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":"a95e5e989a7a2519"}},{"code_sha256_prefix":"101e41fc9ac1b031","entry":"calculate_ppl_given_images","repo":"anon96652/oneshotclip","repo_kind":"official","path":"metrics/ppl.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/metrics/ppl.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":"101e41fc9ac1b031"}},{"code_sha256_prefix":"4f63545a8e689c49","entry":"denormalize","repo":"anon96652/oneshotclip","repo_kind":"official","path":"metrics/utils.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/metrics/utils.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":"4f63545a8e689c49"}},{"code_sha256_prefix":"15df2c2c65353c11","entry":"normalize_tensor","repo":"anon96652/oneshotclip","repo_kind":"official","path":"metrics/ppl.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/metrics/ppl.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":"15df2c2c65353c11"}},{"code_sha256_prefix":"5144ad456049f8ce","entry":"reduce_loss_dict","repo":"anon96652/oneshotclip","repo_kind":"official","path":"distributed.py","file_url":"https://github.com/anon96652/oneshotclip/blob/HEAD/distributed.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":"5144ad456049f8ce"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}