{"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/hairclip-design-your-hair-by-text-and","title":"HairCLIP: Design Your Hair by Text and Reference Image","arxiv_id":"2112.05142","date":"2021-12-09","proceeding":"CVPR 2022 1","authors":["Tianyi Wei","Dongdong Chen","Wenbo Zhou","Jing Liao","Zhentao Tan","Lu Yuan","Weiming Zhang","Nenghai Yu"],"abstract":"Hair editing is an interesting and challenging problem in computer vision and graphics. Many existing methods require well-drawn sketches or masks as conditional inputs for editing, however these interactions are neither straightforward nor efficient. In order to free users from the tedious interaction process, this paper proposes a new hair editing interaction mode, which enables manipulating hair attributes individually or jointly based on the texts or reference images provided by users. For this purpose, we encode the image and text conditions in a shared embedding space and propose a unified hair editing framework by leveraging the powerful image text representation capability of the Contrastive Language-Image Pre-Training (CLIP) model. With the carefully designed network structures and loss functions, our framework can perform high-quality hair editing in a disentangled manner. Extensive experiments demonstrate the superiority of our approach in terms of manipulation accuracy, visual realism of editing results, and irrelevant attribute preservation. Project repo is https://github.com/wty-ustc/HairCLIP.","url_abs":"https://arxiv.org/abs/2112.05142v2","url_pdf":"https://arxiv.org/pdf/2112.05142v2.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":"hairclip-design-your-hair-by-text-and","repo_url":"https://github.com/wty-ustc/hairclip","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"LGPL-2.1"}}],"tasks":[{"task_slug":"attribute","task_name":"Attribute"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2112.05142","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2112.05142"}},"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/wty-ustc/hairclip","reach":{"status":"ok","spdx":"LGPL-2.1"}}],"summary":{"ran":6,"ran_draft_wrong":2,"unverified":1},"by_repo_kind":{"official":{"samples":9,"ran":8,"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":9,"samples":[{"code_sha256_prefix":"b28543ed94f9d144","entry":"get_block","repo":"wty-ustc/hairclip","repo_kind":"official","path":"models/facial_recognition/helpers.py","file_url":"https://github.com/wty-ustc/hairclip/blob/HEAD/models/facial_recognition/helpers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"LGPL-2.1","inline_ok":false,"mcp_get_code":{"code_sha256":"b28543ed94f9d144"}},{"code_sha256_prefix":"d764d1b681a351f3","entry":"get_blocks","repo":"wty-ustc/hairclip","repo_kind":"official","path":"models/facial_recognition/helpers.py","file_url":"https://github.com/wty-ustc/hairclip/blob/HEAD/models/facial_recognition/helpers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"LGPL-2.1","inline_ok":false,"mcp_get_code":{"code_sha256":"d764d1b681a351f3"}},{"code_sha256_prefix":"80a82d5149279cdf","entry":"get_interp_size","repo":"wty-ustc/hairclip","repo_kind":"official","path":"criteria/parse_related_loss/model_utils.py","file_url":"https://github.com/wty-ustc/hairclip/blob/HEAD/criteria/parse_related_loss/model_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"LGPL-2.1","inline_ok":false,"mcp_get_code":{"code_sha256":"80a82d5149279cdf"}},{"code_sha256_prefix":"29b9a890f149a3a6","entry":"get_keys","repo":"wty-ustc/hairclip","repo_kind":"official","path":"mapper/hairclip_mapper.py","file_url":"https://github.com/wty-ustc/hairclip/blob/HEAD/mapper/hairclip_mapper.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"LGPL-2.1","inline_ok":false,"mcp_get_code":{"code_sha256":"29b9a890f149a3a6"}},{"code_sha256_prefix":"3e87c5d93ee4df83","entry":"interp","repo":"wty-ustc/hairclip","repo_kind":"official","path":"criteria/parse_related_loss/model_utils.py","file_url":"https://github.com/wty-ustc/hairclip/blob/HEAD/criteria/parse_related_loss/model_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"LGPL-2.1","inline_ok":false,"mcp_get_code":{"code_sha256":"3e87c5d93ee4df83"}},{"code_sha256_prefix":"c54fea429589425d","entry":"l2_norm","repo":"wty-ustc/hairclip","repo_kind":"official","path":"models/facial_recognition/helpers.py","file_url":"https://github.com/wty-ustc/hairclip/blob/HEAD/models/facial_recognition/helpers.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"LGPL-2.1","inline_ok":false,"mcp_get_code":{"code_sha256":"c54fea429589425d"}},{"code_sha256_prefix":"fcc8ff62e18cf52d","entry":"run_on_batch","repo":"wty-ustc/hairclip","repo_kind":"official","path":"predict.py","file_url":"https://github.com/wty-ustc/hairclip/blob/HEAD/predict.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"LGPL-2.1","inline_ok":false,"mcp_get_code":{"code_sha256":"fcc8ff62e18cf52d"}},{"code_sha256_prefix":"c515c0d3b470330f","entry":"run_on_batch_e4e","repo":"wty-ustc/hairclip","repo_kind":"official","path":"predict.py","file_url":"https://github.com/wty-ustc/hairclip/blob/HEAD/predict.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"LGPL-2.1","inline_ok":false,"mcp_get_code":{"code_sha256":"c515c0d3b470330f"}},{"code_sha256_prefix":"68f02849ad3eb678","entry":"get_upsampling_weight","repo":"wty-ustc/hairclip","repo_kind":"official","path":"criteria/parse_related_loss/model_utils.py","file_url":"https://github.com/wty-ustc/hairclip/blob/HEAD/criteria/parse_related_loss/model_utils.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"LGPL-2.1","inline_ok":false,"mcp_get_code":{"code_sha256":"68f02849ad3eb678"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}