{"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/restyle-a-residual-based-stylegan-encoder-via","title":"ReStyle: A Residual-Based StyleGAN Encoder via Iterative Refinement","arxiv_id":"2104.02699","date":"2021-04-06","proceeding":"ICCV 2021 10","authors":["Yuval Alaluf","Or Patashnik","Daniel Cohen-Or"],"abstract":"Recently, the power of unconditional image synthesis has significantly advanced through the use of Generative Adversarial Networks (GANs). The task of inverting an image into its corresponding latent code of the trained GAN is of utmost importance as it allows for the manipulation of real images, leveraging the rich semantics learned by the network. Recognizing the limitations of current inversion approaches, in this work we present a novel inversion scheme that extends current encoder-based inversion methods by introducing an iterative refinement mechanism. Instead of directly predicting the latent code of a given real image using a single pass, the encoder is tasked with predicting a residual with respect to the current estimate of the inverted latent code in a self-correcting manner. Our residual-based encoder, named ReStyle, attains improved accuracy compared to current state-of-the-art encoder-based methods with a negligible increase in inference time. We analyze the behavior of ReStyle to gain valuable insights into its iterative nature. We then evaluate the performance of our residual encoder and analyze its robustness compared to optimization-based inversion and state-of-the-art encoders.","url_abs":"https://arxiv.org/abs/2104.02699v2","url_pdf":"https://arxiv.org/pdf/2104.02699v2.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":"restyle-a-residual-based-stylegan-encoder-via","repo_url":"https://github.com/yuval-alaluf/restyle-encoder","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"restyle-a-residual-based-stylegan-encoder-via","repo_url":"https://github.com/hcholab/k-salsa","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"real-to-cartoon-translation","task_name":"Real-to-Cartoon translation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2104.02699","atlas_url":"https://app.syntology.ai/?focus=2104.02699","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2104.02699"}},"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/hcholab/k-salsa","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yuval-alaluf/restyle-encoder","reach":null}],"summary":{"ran":2,"unverified":2},"by_repo_kind":{"official":{"samples":4,"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":"c87392ae27b972d1","entry":"EqualLinear","repo":"yuval-alaluf/restyle-encoder","repo_kind":"official","path":"models/encoders/restyle_e4e_encoders.py","file_url":"https://github.com/yuval-alaluf/restyle-encoder/blob/HEAD/models/encoders/restyle_e4e_encoders.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c87392ae27b972d1"}},{"code_sha256_prefix":"9e58946f7d58857e","entry":"GradualStyleBlock","repo":"yuval-alaluf/restyle-encoder","repo_kind":"official","path":"models/encoders/restyle_e4e_encoders.py","file_url":"https://github.com/yuval-alaluf/restyle-encoder/blob/HEAD/models/encoders/restyle_e4e_encoders.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9e58946f7d58857e"}},{"code_sha256_prefix":"bedad5f8ab345722","entry":"ProgressiveStage","repo":"yuval-alaluf/restyle-encoder","repo_kind":"official","path":"models/encoders/restyle_e4e_encoders.py","file_url":"https://github.com/yuval-alaluf/restyle-encoder/blob/HEAD/models/encoders/restyle_e4e_encoders.py","link_basis":"first_harvest_node","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":"bedad5f8ab345722"}},{"code_sha256_prefix":"187a151dab82a827","entry":"ResNetProgressiveBackboneEncoder","repo":"yuval-alaluf/restyle-encoder","repo_kind":"official","path":"models/encoders/restyle_e4e_encoders.py","file_url":"https://github.com/yuval-alaluf/restyle-encoder/blob/HEAD/models/encoders/restyle_e4e_encoders.py","link_basis":"first_harvest_node","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":"187a151dab82a827"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}