{"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/contextual-residual-aggregation-for-ultra","title":"Contextual Residual Aggregation for Ultra High-Resolution Image Inpainting","arxiv_id":"2005.09704","date":"2020-05-19","proceeding":"CVPR 2020 6","authors":["Zili Yi","Qiang Tang","Shekoofeh Azizi","Daesik Jang","Zhan Xu"],"abstract":"Recently data-driven image inpainting methods have made inspiring progress, impacting fundamental image editing tasks such as object removal and damaged image repairing. These methods are more effective than classic approaches, however, due to memory limitations they can only handle low-resolution inputs, typically smaller than 1K. Meanwhile, the resolution of photos captured with mobile devices increases up to 8K. Naive up-sampling of the low-resolution inpainted result can merely yield a large yet blurry result. Whereas, adding a high-frequency residual image onto the large blurry image can generate a sharp result, rich in details and textures. Motivated by this, we propose a Contextual Residual Aggregation (CRA) mechanism that can produce high-frequency residuals for missing contents by weighted aggregating residuals from contextual patches, thus only requiring a low-resolution prediction from the network. Since convolutional layers of the neural network only need to operate on low-resolution inputs and outputs, the cost of memory and computing power is thus well suppressed. Moreover, the need for high-resolution training datasets is alleviated. In our experiments, we train the proposed model on small images with resolutions 512x512 and perform inference on high-resolution images, achieving compelling inpainting quality. Our model can inpaint images as large as 8K with considerable hole sizes, which is intractable with previous learning-based approaches. We further elaborate on the light-weight design of the network architecture, achieving real-time performance on 2K images on a GTX 1080 Ti GPU. Codes are available at: Atlas200dk/sample-imageinpainting-HiFill.","url_abs":"https://arxiv.org/abs/2005.09704v1","url_pdf":"https://arxiv.org/pdf/2005.09704v1.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":"contextual-residual-aggregation-for-ultra","repo_url":"https://github.com/Atlas200dk/sample-imageinpainting-HiFill","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"paper_slug":"contextual-residual-aggregation-for-ultra","repo_url":"https://github.com/duxingren14/Hifill-tensorflow","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"contextual-residual-aggregation-for-ultra","repo_url":"https://github.com/wangyx240/High-Resolution-Image-Inpainting","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"contextual-residual-aggregation-for-ultra","repo_url":"https://github.com/wangyx240/High-Resolution-Image-Inpainting-GAN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"contextual-residual-aggregation-for-ultra","repo_url":"https://github.com/yangyucheng000/CRA","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":{"status":"ok"}},{"paper_slug":"contextual-residual-aggregation-for-ultra","repo_url":"https://github.com/zqhwzd/CRA","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[{"task_slug":"2k","task_name":"2k"},{"task_slug":null,"task_name":"8k"},{"task_slug":null,"task_name":"GPU"},{"task_slug":"image-inpainting","task_name":"Image Inpainting"},{"task_slug":"high","task_name":"Vocal Bursts Intensity Prediction"}],"methods":[{"method_slug":"contextual-residual-aggregation","method_name":"Contextual Residual Aggregation"}],"datasets_introduced":[],"methods_introduced":[{"slug":"contextual-residual-aggregation","name":"Contextual Residual Aggregation","full_name":"Contextual Residual Aggregation"}],"results":[{"leaderboard":"/sota/image-inpainting-on-places2-1","task":"Image Inpainting","dataset":"Places2","model":"HFill","rank_in_archive_order":14,"of":14,"metrics":{"FID":"28.92","P-IDS":"1.24","U-IDS":"11.24"},"uses_additional_data":false},{"leaderboard":"/sota/image-inpainting-on-places2-val","task":"Image Inpainting","dataset":"Places2 val","model":"HiFill (20-30% free form)","rank_in_archive_order":6,"of":7,"metrics":{"FID":"15.7","PD":"92.8"},"uses_additional_data":false},{"leaderboard":"/sota/image-inpainting-on-places2-val","task":"Image Inpainting","dataset":"Places2 val","model":"HiFill (128×128\ncenter mask)","rank_in_archive_order":7,"of":7,"metrics":{"FID":"16.9","PD":"115.4"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2005.09704","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2005.09704"}},"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/yangyucheng000/CRA","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Atlas200dk/sample-imageinpainting-HiFill","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wangyx240/High-Resolution-Image-Inpainting","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zqhwzd/CRA","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wangyx240/High-Resolution-Image-Inpainting-GAN","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/duxingren14/Hifill-tensorflow","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":2,"unverified":7},"by_repo_kind":{"listed":{"samples":9,"ran":2,"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":0,"samples":[{"code_sha256_prefix":"2de9306dafd2843d","entry":"read_imgs_masks","repo":"zqhwzd/CRA","repo_kind":"listed","path":"test_mindspore.py","file_url":"https://github.com/zqhwzd/CRA/blob/HEAD/test_mindspore.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2de9306dafd2843d"}},{"code_sha256_prefix":"c86123f64778dad8","entry":"sort","repo":"zqhwzd/CRA","repo_kind":"listed","path":"test_mindspore.py","file_url":"https://github.com/zqhwzd/CRA/blob/HEAD/test_mindspore.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c86123f64778dad8"}},{"code_sha256_prefix":"b1e0f756ec3d6ff3","entry":"flatten","repo":"duxingren14/Hifill-tensorflow","repo_kind":"listed","path":"ops.py","file_url":"https://github.com/duxingren14/Hifill-tensorflow/blob/HEAD/ops.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":"b1e0f756ec3d6ff3"}},{"code_sha256_prefix":"11dd860bdbcccbba","entry":"gan_wgan_loss","repo":"duxingren14/Hifill-tensorflow","repo_kind":"listed","path":"ops.py","file_url":"https://github.com/duxingren14/Hifill-tensorflow/blob/HEAD/ops.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":"11dd860bdbcccbba"}},{"code_sha256_prefix":"be7eb920c4ea5b2b","entry":"get_input_queue","repo":"duxingren14/Hifill-tensorflow","repo_kind":"listed","path":"trainer.py","file_url":"https://github.com/duxingren14/Hifill-tensorflow/blob/HEAD/trainer.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":"be7eb920c4ea5b2b"}},{"code_sha256_prefix":"87cdf8d972e83adf","entry":"load_yml","repo":"duxingren14/Hifill-tensorflow","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/duxingren14/Hifill-tensorflow/blob/HEAD/utils.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":"87cdf8d972e83adf"}},{"code_sha256_prefix":"185ee23424c1201b","entry":"preprocess_image","repo":"duxingren14/Hifill-tensorflow","repo_kind":"listed","path":"trainer.py","file_url":"https://github.com/duxingren14/Hifill-tensorflow/blob/HEAD/trainer.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":"185ee23424c1201b"}},{"code_sha256_prefix":"4a464b401403660e","entry":"read_images","repo":"duxingren14/Hifill-tensorflow","repo_kind":"listed","path":"trainer.py","file_url":"https://github.com/duxingren14/Hifill-tensorflow/blob/HEAD/trainer.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":"4a464b401403660e"}},{"code_sha256_prefix":"d014eb2c7ea0869f","entry":"resize","repo":"duxingren14/Hifill-tensorflow","repo_kind":"listed","path":"ops.py","file_url":"https://github.com/duxingren14/Hifill-tensorflow/blob/HEAD/ops.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":"d014eb2c7ea0869f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}