{"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/aggregated-contextual-transformations-for","title":"Aggregated Contextual Transformations for High-Resolution Image Inpainting","arxiv_id":"2104.01431","date":"2021-04-03","proceeding":null,"authors":["Yanhong Zeng","Jianlong Fu","Hongyang Chao","Baining Guo"],"abstract":"State-of-the-art image inpainting approaches can suffer from generating distorted structures and blurry textures in high-resolution images (e.g., 512x512). The challenges mainly drive from (1) image content reasoning from distant contexts, and (2) fine-grained texture synthesis for a large missing region. To overcome these two challenges, we propose an enhanced GAN-based model, named Aggregated COntextual-Transformation GAN (AOT-GAN), for high-resolution image inpainting. Specifically, to enhance context reasoning, we construct the generator of AOT-GAN by stacking multiple layers of a proposed AOT block. The AOT blocks aggregate contextual transformations from various receptive fields, allowing to capture both informative distant image contexts and rich patterns of interest for context reasoning. For improving texture synthesis, we enhance the discriminator of AOT-GAN by training it with a tailored mask-prediction task. Such a training objective forces the discriminator to distinguish the detailed appearances of real and synthesized patches, and in turn, facilitates the generator to synthesize clear textures. Extensive comparisons on Places2, the most challenging benchmark with 1.8 million high-resolution images of 365 complex scenes, show that our model outperforms the state-of-the-art by a significant margin in terms of FID with 38.60% relative improvement. A user study including more than 30 subjects further validates the superiority of AOT-GAN. We further evaluate the proposed AOT-GAN in practical applications, e.g., logo removal, face editing, and object removal. Results show that our model achieves promising completions in the real world. We release code and models in https://github.com/researchmm/AOT-GAN-for-Inpainting.","url_abs":"https://arxiv.org/abs/2104.01431v1","url_pdf":"https://arxiv.org/pdf/2104.01431v1.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":"aggregated-contextual-transformations-for","repo_url":"https://github.com/researchmm/AOT-GAN-for-Inpainting","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"aggregated-contextual-transformations-for","repo_url":"https://github.com/zyddnys/manga-image-translator","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"GPL-3.0"}}],"tasks":[{"task_slug":"image-inpainting","task_name":"Image Inpainting"},{"task_slug":"texture-synthesis","task_name":"Texture Synthesis"},{"task_slug":"high","task_name":"Vocal Bursts Intensity Prediction"}],"methods":[{"method_slug":"pixel-prediction","method_name":"Inpainting"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-inpainting-on-places2-1","task":"Image Inpainting","dataset":"Places2","model":"AOT GAN","rank_in_archive_order":10,"of":14,"metrics":{"FID":"10.64","P-IDS":"3.07","U-IDS":"19.92"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2104.01431","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2104.01431"}},"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/zyddnys/manga-image-translator","reach":{"status":"ok","spdx":"GPL-3.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/researchmm/AOT-GAN-for-Inpainting","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":8},"by_repo_kind":{"official":{"samples":8,"ran":0,"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":"696aaa9159ec0242","entry":"compare_mae","repo":"researchmm/AOT-GAN-for-Inpainting","repo_kind":"official","path":"src/metric/metric.py","file_url":"https://github.com/researchmm/AOT-GAN-for-Inpainting/blob/HEAD/src/metric/metric.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"696aaa9159ec0242"}},{"code_sha256_prefix":"79b69e57842dec46","entry":"compare_psnr","repo":"researchmm/AOT-GAN-for-Inpainting","repo_kind":"official","path":"src/metric/metric.py","file_url":"https://github.com/researchmm/AOT-GAN-for-Inpainting/blob/HEAD/src/metric/metric.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"79b69e57842dec46"}},{"code_sha256_prefix":"76972afd738d859f","entry":"compare_ssim","repo":"researchmm/AOT-GAN-for-Inpainting","repo_kind":"official","path":"src/metric/metric.py","file_url":"https://github.com/researchmm/AOT-GAN-for-Inpainting/blob/HEAD/src/metric/metric.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"76972afd738d859f"}},{"code_sha256_prefix":"b98ab675041aad53","entry":"gaussian","repo":"researchmm/AOT-GAN-for-Inpainting","repo_kind":"official","path":"src/loss/common.py","file_url":"https://github.com/researchmm/AOT-GAN-for-Inpainting/blob/HEAD/src/loss/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b98ab675041aad53"}},{"code_sha256_prefix":"0dcc94152add7d84","entry":"get_gaussian_kernel","repo":"researchmm/AOT-GAN-for-Inpainting","repo_kind":"official","path":"src/loss/common.py","file_url":"https://github.com/researchmm/AOT-GAN-for-Inpainting/blob/HEAD/src/loss/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0dcc94152add7d84"}},{"code_sha256_prefix":"67c8db4295ee7765","entry":"get_gaussian_kernel2d","repo":"researchmm/AOT-GAN-for-Inpainting","repo_kind":"official","path":"src/loss/common.py","file_url":"https://github.com/researchmm/AOT-GAN-for-Inpainting/blob/HEAD/src/loss/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"67c8db4295ee7765"}},{"code_sha256_prefix":"c393732b001f32af","entry":"my_layer_norm","repo":"researchmm/AOT-GAN-for-Inpainting","repo_kind":"official","path":"src/model/aotgan.py","file_url":"https://github.com/researchmm/AOT-GAN-for-Inpainting/blob/HEAD/src/model/aotgan.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c393732b001f32af"}},{"code_sha256_prefix":"ad885f4237051200","entry":"reduce_loss_dict","repo":"researchmm/AOT-GAN-for-Inpainting","repo_kind":"official","path":"src/trainer/common.py","file_url":"https://github.com/researchmm/AOT-GAN-for-Inpainting/blob/HEAD/src/trainer/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ad885f4237051200"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}