SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2005.09704 · 2020

Contextual Residual Aggregation for Ultra High-Resolution Image Inpainting

arXiv · PDF · Open in the Atlas

Code that ran

5 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 2 failures of our instrument; 4 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2005.09704.json · badge: /api/ran/2005.09704.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
duxingren14/Hifill-tensorflow community (classifier label)
classifier basis not recorded on the link
3 ran · 4 no recorded run
zqhwzd/CRA reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
flatten Ran
ran on a synthesized input
duxingren14/Hifill-tensorflow/ops.py
code served (permissive licence) · get_code("b1e0f756ec3d6ff3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned EagerTensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf
import numpy as np

# Create a small tensor with batch size 2 and flattened dimension 12 (3x4)
x = tf.constant(np.random.randn(2, 3, 4).astype(np.float32))

ARGS = {
    'x': x,
    'name': 'test_flatten'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py recorded SymbolicTensor ndim 2, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gan_wgan_loss Ran
ran on a synthesized input
duxingren14/Hifill-tensorflow/ops.py
code served (permissive licence) · get_code("11dd860bdbcccbba")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Create small positive and negative tensors
# These will be discriminator outputs or similar model predictions
pos = tf.constant([[0.1, 0.2, 0.3, 0.4],
                   [0.5, 0.6, 0.7, 0.8]], dtype=tf.float32)

neg = tf.constant([[0.9, 0.8, 0.7, 0.6],
                   [0.5, 0.4, 0.3, 0.2]], dtype=tf.float32)

name = "wgan_loss"

ARGS = {
    "pos": pos,
    "neg": neg,
    "name": name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_imgs_masks Ran
ran; our contract draft was wrong, not the code
zqhwzd/CRA/test_mindspore.py
code served (permissive licence) · get_code("2de9306dafd2843d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import argparse
import os
import tempfile

# Create temporary directories with mock image and mask files
temp_dir = tempfile.mkdtemp()
image_dir = os.path.join(temp_dir, 'images')
mask_dir = os.path.join(temp_dir, 'masks')

os.makedirs(image_dir, exist_ok=True)
os.makedirs(mask_dir, exist_ok=True)

# Create some mock image files with valid extensions
for i in range(3):
    open(os.path.join(image_dir, f'image_{i}.jpg'), 'w').close()
    open(os.path.join(image_dir, f'image_{i}.png'), 'w').close()

# Create some mock mask files with valid extensions
for i in range(3):
    open(os.path.join(mask_dir, f'mask_{i}.jpg'), 'w').close()
    open(os.path.join(mask_dir, f'mask_{i}.PNG'), 'w').close()

# Create args object with required attributes
class Args:
    def __init__(self):
        self.image_dir = image_dir
        self.mask_dir = mask_dir

args_obj = Args()

ARGS = {
    'args': args_obj
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
resize Ran
ran on a synthesized input
duxingren14/Hifill-tensorflow/ops.py
code served (permissive licence) · get_code("d014eb2c7ea0869f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned MockTensor. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a mock TensorFlow-like tensor object with get_shape() method
class MockTensor:
    def __init__(self, shape):
        self.shape = shape
    
    def get_shape(self):
        return self
    
    def as_list(self):
        return list(self.shape)

# Create a mock resize function that takes img and to_shape
def mock_resize_func(img, to_shape):
    # This function simulates tf.image.resize behavior
    return img

# Set up the arguments
img = MockTensor((2, 4, 3, 3))  # batch=2, height=4, width=3, channels=3

ARGS = {
    "img": img,
    "to_shape": None,
    "scale": None,
    "func": mock_resize_func
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MockTensor — a MockTensor output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockTensor output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sort Ran
ran; our contract draft was wrong, not the code
zqhwzd/CRA/test_mindspore.py
code served (permissive licence) · get_code("c86123f64778dad8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

str_lst = ["banana", "apple", "cherry", "date", "elderberry"]

ARGS = {
    "str_lst": str_lst
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_input_queue Not yet run
unverified (harvested, no recorded run)
duxingren14/Hifill-tensorflow/trainer.py
code served (permissive licence) · get_code("be7eb920c4ea5b2b")
How it ran

no invocation recorded.

load_yml Not yet run
unverified (harvested, no recorded run)
duxingren14/Hifill-tensorflow/utils.py
code served (permissive licence) · get_code("87cdf8d972e83adf")
How it ran

no invocation recorded.

preprocess_image Not yet run
unverified (harvested, no recorded run)
duxingren14/Hifill-tensorflow/trainer.py
code served (permissive licence) · get_code("185ee23424c1201b")
How it ran

no invocation recorded.

read_images Not yet run
unverified (harvested, no recorded run)
duxingren14/Hifill-tensorflow/trainer.py
code served (permissive licence) · get_code("4a464b401403660e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2005.09704")
get_code_for_paper("2005.09704")
have("2005.09704")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2005.09704.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2005.09704.svg)](https://syntology.ai/paper/2005.09704)

Connect an agent — have() is free.