SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.05950 · 2022

ZITS++: Image Inpainting by Improving the Incremental Transformer on Structural Priors

arXiv · PDF · Open in the Atlas

Code that ran

8 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, 1 violated it and 4 have no contract verdict; 3 failures of our instrument; 1 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/2210.05950.json · badge: /api/ran/2210.05950.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
ewrfcas/zits-plusplus canonical (classifier label)
classifier basis not recorded on the link
8 ran · 1 no recorded run
FunctionStatusWhere it lives
calculate_activation_statistics Ran
ran; our contract draft was wrong, not the code
ewrfcas/zits-plusplus/inpainting_metric.py
code served (permissive licence) · get_code("1c2fb75a32c87a57")
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. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable

torch.manual_seed(0)

class SimpleInceptionModel(nn.Module):
    """Minimal inception-like model that returns a tensor with spatial dimensions."""
    def __init__(self):
        super(SimpleInceptionModel, self).__init__()
        self.conv1 = nn.Conv2d(3, 4, kernel_size=3, padding=1)
        self.avgpool = nn.AdaptiveAvgPool2d((1, 1))
    
    def forward(self, x):
        x = self.conv1(x)
        x = self.avgpool(x)
        return (x,)

model = SimpleInceptionModel()
model.eval()

images = np.random.rand(6, 3, 8, 8).astype(np.float32)

ARGS = {
    "images": images,
    "model": model,
    "batch_size": 2,
    "dims": 4,
    "cuda": False,
    "verbose": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
calculate_frechet_distance Ran
ran, violated the contract we drafted
ewrfcas/zits-plusplus/inpainting_metric.py
code served (permissive licence) · get_code("d059051e90165ebe")
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 float32, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np
from scipy import linalg

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

# Create small sample statistics for Frechet Distance calculation
# mu1 and mu2 are mean vectors (1D arrays)
# sigma1 and sigma2 are covariance matrices (2D arrays)

dim = 4  # Feature dimension

# Generate mean vectors
mu1 = np.random.randn(dim).astype(np.float32)
mu2 = np.random.randn(dim).astype(np.float32)

# Generate positive semi-definite covariance matrices
# Create them as A @ A.T to ensure they're positive semi-definite
A1 = np.random.randn(dim, dim).astype(np.float32)
sigma1 = (A1 @ A1.T).astype(np.float32)

A2 = np.random.randn(dim, dim).astype(np.float32)
sigma2 = (A2 @ A2.T).astype(np.float32)

eps = 1e-06

ARGS = {
    'mu1': mu1,
    'sigma1': sigma1,
    'mu2': mu2,
    'sigma2': sigma2,
    'eps': eps
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float32, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
feature2token Ran
ran on a synthesized input
ewrfcas/zits-plusplus/networks/mat.py
code served (permissive licence) · get_code("7831601a1f93f0b6")
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 Tensor, ndim 3, dtype family float, shape (2, 15, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

# The function takes a tensor x with shape (B, C, H, W)
# and reshapes it to (B, H*W, C)
# We need to construct a 4D tensor with distinct dimensions

x = torch.randn(2, 4, 3, 5)  # B=2, C=4, H=3, W=5

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 15, 4) — shape (2, 15, 4) as a later run recorded it
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
feature_matching_loss Ran
ran on a synthesized input
ewrfcas/zits-plusplus/networks/losses.py
code served (permissive licence) · get_code("1ec3907b9c7cefae")
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 Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 torch.nn.functional as F

torch.manual_seed(0)

# Create fake_features: list of tensors with different spatial dimensions
# Each tensor has shape (batch, channels, height, width)
fake_features = [
    torch.randn(2, 4, 8, 8),
    torch.randn(2, 4, 4, 4),
    torch.randn(2, 4, 2, 2),
]

# Create target_features: list of tensors matching fake_features shapes
target_features = [
    torch.randn(2, 4, 8, 8),
    torch.randn(2, 4, 4, 4),
    torch.randn(2, 4, 2, 2),
]

# Create mask: shape (batch, 1, height, width)
# This will be interpolated to match each feature map's spatial dimensions
mask = torch.randn(2, 1, 16, 16)

ARGS = {
    "fake_features": fake_features,
    "target_features": target_features,
    "mask": mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
generator_loss Ran
ran on a synthesized input
ewrfcas/zits-plusplus/networks/losses.py
code served (permissive licence) · get_code("7ccf005b1c05d4da")
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 Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 torch.nn.functional as F

torch.manual_seed(0)

# Create a batch of fake discriminator predictions
# Shape: (batch_size, channels, height, width)
discr_fake_pred = torch.randn(2, 1, 4, 3)

# Create a mask with the same spatial dimensions as discr_fake_pred
# Shape: (batch_size, channels, height, width)
mask = torch.randint(0, 2, (2, 1, 4, 3)).float()

# Create args dictionary with all required keys
args = {
    'mask_as_fake_target': True,
    'extra_mask_weight_for_gen': 0.5,
    'use_unmasked_for_gen': True,
    'allow_scale_mask': True,
    'mask_scale_mode': 'nearest',
    'weight': 1.0
}

ARGS = {
    'discr_fake_pred': discr_fake_pred,
    'mask': mask,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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_activations Ran
ran; our contract draft was wrong, not the code
ewrfcas/zits-plusplus/inpainting_metric.py
code served (permissive licence) · get_code("18bfc140d0a26202")
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 ndarray, ndim 2, dtype family float, shape (8, 2048) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type, ndim and shape 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 torch.nn as nn
import numpy as np

torch.manual_seed(0)

class MockInceptionModel(nn.Module):
    def __init__(self):
        super(MockInceptionModel, self).__init__()
        self.fc = nn.Linear(2048, 2048)
    
    def forward(self, x):
        # Input: (batch_size, 3, height, width)
        # Output: (batch_size, 2048, spatial_h, spatial_w)
        batch_size = x.shape[0]
        # Return a tuple where first element is the feature tensor
        output = torch.randn(batch_size, 2048, 4, 5)
        return (output,)

# Create mock images: (n_images, 3, height, width) with values between 0 and 1
images = np.random.rand(8, 3, 32, 32).astype(np.float32)

# Create the model
model = MockInceptionModel()

ARGS = {
    'images': images,
    'model': model,
    'batch_size': 2,
    'dims': 2048,
    'cuda': False,
    'verbose': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (8, 2048) — shape (8, 2048) as a later run recorded it
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
interpolate_mask Ran
ran on a synthesized input
ewrfcas/zits-plusplus/networks/losses.py
code served (permissive licence) · get_code("7d0746f0685aabac")
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 Tensor, ndim 4, dtype family float, shape (2, 4, 4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 torch.nn.functional as F

torch.manual_seed(0)

# Create a small mask tensor with shape (batch, channels, height, width)
mask = torch.randn(2, 4, 8, 6)

# Define target shape (height, width)
shape = (4, 3)

# allow_scale_mask: boolean flag to allow scaling
allow_scale_mask = True

# mask_scale_mode: interpolation mode
mask_scale_mode = 'nearest'

ARGS = {
    'mask': mask,
    'shape': shape,
    'allow_scale_mask': allow_scale_mask,
    'mask_scale_mode': mask_scale_mode
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 4, 3) — shape (2, 4, 4, 3) as a later run recorded it
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
token2feature Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ewrfcas/zits-plusplus/networks/mat.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from daidaijr/EAMamba, is pointer only (licence: NONE) · get_code("e9a442dad357d4a7")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from daidaijr/EAMamba, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

spectral_norm Not yet run
unverified (harvested, no recorded run)
ewrfcas/zits-plusplus/networks/layers.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tsingqguo/misf, is pointer only (licence: NONE) · get_code("b189ed0149b76880")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from tsingqguo/misf, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. 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, 6 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 4 later) and 3 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.

FunctionAlso present inEarliest-datedOthers named
spectral_norm 14 other papers
9 dated earlier, 4 later, 1 same year, order not determinable · 5 only as an assembly brick
1804.07723 (2018-04)
Image Inpainting for Irregular Holes Using Partial Convolutions
1908.00463 (2019-08)
DIODE: A Dense Indoor and Outdoor DEpth Dataset
1911.10375 (2019-11)
Region Normalization for Image Inpainting
and 11 more not named here
calculate_activation_statistics 5 other papers
3 dated earlier, 2 later
Guo_Painting_From_Part_ICCV_2021_paper (2021 (year only))
Painting from Part
2103.15087 (2021-03)
Learning a Sketch Tensor Space for Image Inpainting of Man-made Scenes
2203.00867 (2022-03)
Incremental Transformer Structure Enhanced Image Inpainting with Masking Positional Encoding
and 2 more not named here
calculate_frechet_distance 3 other papers
3 dated earlier
2103.15087 (2021-03)
Learning a Sketch Tensor Space for Image Inpainting of Man-made Scenes
2108.08020 (2021-08)
Speech Drives Templates: Co-Speech Gesture Synthesis with Learned Templates
2203.00867 (2022-03)
Incremental Transformer Structure Enhanced Image Inpainting with Masking Positional Encoding
get_activations 2 other papers
2 dated earlier
2103.15087 (2021-03)
Learning a Sketch Tensor Space for Image Inpainting of Man-made Scenes
2203.00867 (2022-03)
Incremental Transformer Structure Enhanced Image Inpainting with Masking Positional Encoding
token2feature 2 other papers
2 later
aaai_28484 (2024 (year only))
FoSp: Focus and Separation Network for Early Smoke Segmentation
2506.22246 (2025-06)
EAMamba: Efficient All-Around Vision State Space Model for Image Restoration
feature2token 1 other paper
1 later
aaai_28484 (2024 (year only))
FoSp: Focus and Separation Network for Early Smoke Segmentation

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

Image inpainting involves filling missing areas of a corrupted image. Despite impressive results have been achieved recently, restoring images with both vivid textures and reasonable structures remains a significant challenge. Previous methods have primarily addressed regular textures while disregarding holistic structures due to the limited receptive fields of Convolutional Neural Networks (CNNs). To this end, we study learning a Zero-initialized residual addition based Incremental Transformer on Structural priors (ZITS++), an improved model upon our conference work, ZITS. Specifically, given one corrupt image, we present the Transformer Structure Restorer (TSR) module to restore holistic structural priors at low image resolution, which are further upsampled by Simple Structure Upsampler (SSU) module to higher image resolution. To recover image texture details, we use the Fourier CNN Texture Restoration (FTR) module, which is strengthened by Fourier and large-kernel attention convolutions. Furthermore, to enhance the FTR, the upsampled structural priors from TSR are further processed by Structure Feature Encoder (SFE) and optimized with the Zero-initialized Residual Addition (ZeroRA) incrementally. Besides, a new masking positional encoding is proposed to encode the large irregular masks. Compared with ZITS, ZITS++ improves the FTR's stability and inpainting ability with several techniques. More importantly, we comprehensively explore the effects of various image priors for inpainting and investigate how to utilize them to address high-resolution image inpainting with extensive experiments. This investigation is orthogonal to most inpainting approaches and can thus significantly benefit the community. Codes and models will be released in https://github.com/ewrfcas/ZITS-PlusPlus.

For agents

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

get_harvested_code_for_paper("2210.05950")
get_code_for_paper("2210.05950")
have("2210.05950")

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

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

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

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

Connect an agent — have() is free.