{"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/st-gan-spatial-transformer-generative","title":"ST-GAN: Spatial Transformer Generative Adversarial Networks for Image Compositing","arxiv_id":"1803.01837","date":"2018-03-05","proceeding":"CVPR 2018 6","authors":["Chen-Hsuan Lin","Ersin Yumer","Oliver Wang","Eli Shechtman","Simon Lucey"],"abstract":"We address the problem of finding realistic geometric corrections to a\nforeground object such that it appears natural when composited into a\nbackground image. To achieve this, we propose a novel Generative Adversarial\nNetwork (GAN) architecture that utilizes Spatial Transformer Networks (STNs) as\nthe generator, which we call Spatial Transformer GANs (ST-GANs). ST-GANs seek\nimage realism by operating in the geometric warp parameter space. In\nparticular, we exploit an iterative STN warping scheme and propose a sequential\ntraining strategy that achieves better results compared to naive training of a\nsingle generator. One of the key advantages of ST-GAN is its applicability to\nhigh-resolution images indirectly since the predicted warp parameters are\ntransferable between reference frames. We demonstrate our approach in two\napplications: (1) visualizing how indoor furniture (e.g. from product images)\nmight be perceived in a room, (2) hallucinating how accessories like glasses\nwould look when matched with real portraits.","url_abs":"http://arxiv.org/abs/1803.01837v1","url_pdf":"http://arxiv.org/pdf/1803.01837v1.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":"st-gan-spatial-transformer-generative","repo_url":"https://github.com/chenhsuanlin/spatial-transformer-GAN","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"st-gan-spatial-transformer-generative","repo_url":"https://github.com/lix3972/https-github.com-chenhsuanlin-spatial-transformer-GAN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":null,"task_name":"Generative Adversarial Network"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"spatial-transformer","method_name":"Spatial Transformer"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1803.01837","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1803.01837"}},"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/chenhsuanlin/spatial-transformer-GAN","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lix3972/https-github.com-chenhsuanlin-spatial-transformer-GAN","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":2,"unverified":11},"by_repo_kind":{"official":{"samples":10,"ran":0,"repositories":1},"listed":{"samples":3,"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":"045caed495c3be39","entry":"toGreen","repo":"lix3972/https-github.com-chenhsuanlin-spatial-transformer-GAN","repo_kind":"listed","path":"glasses/util.py","file_url":"https://github.com/lix3972/https-github.com-chenhsuanlin-spatial-transformer-GAN/blob/HEAD/glasses/util.py","link_basis":"plan_row","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":"045caed495c3be39"}},{"code_sha256_prefix":"23debb41fe868b57","entry":"toRed","repo":"lix3972/https-github.com-chenhsuanlin-spatial-transformer-GAN","repo_kind":"listed","path":"glasses/util.py","file_url":"https://github.com/lix3972/https-github.com-chenhsuanlin-spatial-transformer-GAN/blob/HEAD/glasses/util.py","link_basis":"plan_row","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":"23debb41fe868b57"}},{"code_sha256_prefix":"d333acbd22f1fd12","entry":"compose","repo":"chenhsuanlin/spatial-transformer-GAN","repo_kind":"official","path":"glasses/warp.py","file_url":"https://github.com/chenhsuanlin/spatial-transformer-GAN/blob/HEAD/glasses/warp.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":"d333acbd22f1fd12"}},{"code_sha256_prefix":"b1c0d809510d7dee","entry":"composite","repo":"chenhsuanlin/spatial-transformer-GAN","repo_kind":"official","path":"glasses/graph.py","file_url":"https://github.com/chenhsuanlin/spatial-transformer-GAN/blob/HEAD/glasses/graph.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":"b1c0d809510d7dee"}},{"code_sha256_prefix":"3c02b07781bd054e","entry":"discriminator","repo":"chenhsuanlin/spatial-transformer-GAN","repo_kind":"official","path":"glasses/graph.py","file_url":"https://github.com/chenhsuanlin/spatial-transformer-GAN/blob/HEAD/glasses/graph.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":"3c02b07781bd054e"}},{"code_sha256_prefix":"5dfbbadd25cd659e","entry":"fit","repo":"chenhsuanlin/spatial-transformer-GAN","repo_kind":"official","path":"glasses/warp.py","file_url":"https://github.com/chenhsuanlin/spatial-transformer-GAN/blob/HEAD/glasses/warp.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":"5dfbbadd25cd659e"}},{"code_sha256_prefix":"f027fae9fd59cbd6","entry":"imread","repo":"chenhsuanlin/spatial-transformer-GAN","repo_kind":"official","path":"glasses/util.py","file_url":"https://github.com/chenhsuanlin/spatial-transformer-GAN/blob/HEAD/glasses/util.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":"f027fae9fd59cbd6"}},{"code_sha256_prefix":"4497ff1ceb01b614","entry":"imread","repo":"lix3972/https-github.com-chenhsuanlin-spatial-transformer-GAN","repo_kind":"listed","path":"glasses/util.py","file_url":"https://github.com/lix3972/https-github.com-chenhsuanlin-spatial-transformer-GAN/blob/HEAD/glasses/util.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":"4497ff1ceb01b614"}},{"code_sha256_prefix":"e2db836dae92016c","entry":"inverse","repo":"chenhsuanlin/spatial-transformer-GAN","repo_kind":"official","path":"glasses/warp.py","file_url":"https://github.com/chenhsuanlin/spatial-transformer-GAN/blob/HEAD/glasses/warp.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":"e2db836dae92016c"}},{"code_sha256_prefix":"bc55ffac0f03d4f5","entry":"load","repo":"chenhsuanlin/spatial-transformer-GAN","repo_kind":"official","path":"glasses/data.py","file_url":"https://github.com/chenhsuanlin/spatial-transformer-GAN/blob/HEAD/glasses/data.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":"bc55ffac0f03d4f5"}},{"code_sha256_prefix":"2a185557c2573563","entry":"load_homo","repo":"chenhsuanlin/spatial-transformer-GAN","repo_kind":"official","path":"indoor/data.py","file_url":"https://github.com/chenhsuanlin/spatial-transformer-GAN/blob/HEAD/indoor/data.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":"2a185557c2573563"}},{"code_sha256_prefix":"ad896d56681f4a3d","entry":"makeBatch","repo":"chenhsuanlin/spatial-transformer-GAN","repo_kind":"official","path":"glasses/data.py","file_url":"https://github.com/chenhsuanlin/spatial-transformer-GAN/blob/HEAD/glasses/data.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":"ad896d56681f4a3d"}},{"code_sha256_prefix":"247b153b64fa322c","entry":"makeBatchEval","repo":"chenhsuanlin/spatial-transformer-GAN","repo_kind":"official","path":"glasses/data.py","file_url":"https://github.com/chenhsuanlin/spatial-transformer-GAN/blob/HEAD/glasses/data.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":"247b153b64fa322c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}