{"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/swapping-autoencoder-for-deep-image","title":"Swapping Autoencoder for Deep Image Manipulation","arxiv_id":"2007.00653","date":"2020-07-01","proceeding":"NeurIPS 2020 12","authors":["Taesung Park","Jun-Yan Zhu","Oliver Wang","Jingwan Lu","Eli Shechtman","Alexei A. Efros","Richard Zhang"],"abstract":"Deep generative models have become increasingly effective at producing realistic images from randomly sampled seeds, but using such models for controllable manipulation of existing images remains challenging. We propose the Swapping Autoencoder, a deep model designed specifically for image manipulation, rather than random sampling. The key idea is to encode an image with two independent components and enforce that any swapped combination maps to a realistic image. In particular, we encourage the components to represent structure and texture, by enforcing one component to encode co-occurrent patch statistics across different parts of an image. As our method is trained with an encoder, finding the latent codes for a new input image becomes trivial, rather than cumbersome. As a result, it can be used to manipulate real input images in various ways, including texture swapping, local and global editing, and latent code vector arithmetic. Experiments on multiple datasets show that our model produces better results and is substantially more efficient compared to recent generative models.","url_abs":"https://arxiv.org/abs/2007.00653v2","url_pdf":"https://arxiv.org/pdf/2007.00653v2.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":"swapping-autoencoder-for-deep-image","repo_url":"https://github.com/erenovic/SADIM","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"swapping-autoencoder-for-deep-image","repo_url":"https://github.com/rosinality/swapping-autoencoder-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"swapping-autoencoder-for-deep-image","repo_url":"https://github.com/taesungp/swapping-autoencoder-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"swapping-autoencoder-for-deep-image","repo_url":"https://github.com/zhangqianhui/Swapping-Autoencoder-tf","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null}],"tasks":[{"task_slug":"image-manipulation","task_name":"Image Manipulation"}],"methods":[{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"path-length-regularization","method_name":"Path Length Regularization"},{"method_slug":"r1-regularization","method_name":"R1 Regularization"},{"method_slug":"stylegan2","method_name":"StyleGAN2"},{"method_slug":"weight-demodulation","method_name":"Weight Demodulation"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2007.00653","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2007.00653"}},"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/taesungp/swapping-autoencoder-pytorch","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/rosinality/swapping-autoencoder-pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/erenovic/SADIM","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zhangqianhui/Swapping-Autoencoder-tf","reach":null}],"summary":{"ran":2,"ran_fixture":1,"unverified":4},"by_repo_kind":{"listed":{"samples":7,"ran":3,"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":7,"samples":[{"code_sha256_prefix":"a28beb72888ae240","entry":"BaseModel","repo":"taesungp/swapping-autoencoder-pytorch","repo_kind":"listed","path":"models/swapping_autoencoder_model.py","file_url":"https://github.com/taesungp/swapping-autoencoder-pytorch/blob/HEAD/models/swapping_autoencoder_model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"a28beb72888ae240"}},{"code_sha256_prefix":"0d23b11b7690b9fd","entry":"SwappingAutoencoderModel","repo":"taesungp/swapping-autoencoder-pytorch","repo_kind":"listed","path":"models/swapping_autoencoder_model.py","file_url":"https://github.com/taesungp/swapping-autoencoder-pytorch/blob/HEAD/models/swapping_autoencoder_model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"0d23b11b7690b9fd"}},{"code_sha256_prefix":"8cf411cde4e9394b","entry":"gan_loss","repo":"taesungp/swapping-autoencoder-pytorch","repo_kind":"listed","path":"models/swapping_autoencoder_model.py","file_url":"https://github.com/taesungp/swapping-autoencoder-pytorch/blob/HEAD/models/swapping_autoencoder_model.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"8cf411cde4e9394b"}},{"code_sha256_prefix":"bbe76417451f3d85","entry":"BaseNetwork","repo":"taesungp/swapping-autoencoder-pytorch","repo_kind":"listed","path":"models/swapping_autoencoder_model.py","file_url":"https://github.com/taesungp/swapping-autoencoder-pytorch/blob/HEAD/models/swapping_autoencoder_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"bbe76417451f3d85"}},{"code_sha256_prefix":"ac91db41b052c658","entry":"SAE","repo":"zhangqianhui/Swapping-Autoencoder-tf","repo_kind":"listed","path":"SwapAutoEncoderAdaIN.py","file_url":"https://github.com/zhangqianhui/Swapping-Autoencoder-tf/blob/HEAD/SwapAutoEncoderAdaIN.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ac91db41b052c658"}},{"code_sha256_prefix":"b61698cc6c11710b","entry":"create_network","repo":"taesungp/swapping-autoencoder-pytorch","repo_kind":"listed","path":"models/swapping_autoencoder_model.py","file_url":"https://github.com/taesungp/swapping-autoencoder-pytorch/blob/HEAD/models/swapping_autoencoder_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"b61698cc6c11710b"}},{"code_sha256_prefix":"e5c01a59af3b0252","entry":"find_network_using_name","repo":"taesungp/swapping-autoencoder-pytorch","repo_kind":"listed","path":"models/swapping_autoencoder_model.py","file_url":"https://github.com/taesungp/swapping-autoencoder-pytorch/blob/HEAD/models/swapping_autoencoder_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"e5c01a59af3b0252"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}