SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2208.11844 · ECCV · 2022

Unbiased Multi-Modality Guidance for Image Inpainting

Skip Connection, Yongsheng Yu, Libo Zhang, Dawei Du, C Concatenation, Tiejian Luo

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (6 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2208.11844.json · badge: /api/ran/2208.11844.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
yeates/MMT community
Papers with Code archive
8 ran · 3 no recorded run
FunctionStatusWhere it lives
ACBlock Ran
ran on a synthesized input · constructed an object; no result was computed
yeates/MMT/modules/MMT.py
code served (permissive licence) · get_code("3e7b18786256fc81")
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 an instance of its own class, ACBlock: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'in_channel': 4,
    'out_channel': 8,
    'rates': [1, 3, 6, 9]
}
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 ACBlock — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ACBlock 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
ADN Ran
ran on a synthesized input · constructed an object; no result was computed
yeates/MMT/modules/MMT.py
code served (permissive licence) · get_code("03366139f67fc307")
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 an instance of its own class, ADN: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

# ADN expects:
# - channel: int (primary channel dimension)
# - auxiliary_channel: int (auxiliary input channel dimension)
# The forward method expects:
# - x: [batch_size, channel, h_prime, w_prime] where h_prime and w_prime match scale_dic[channel]
# - auxiliary: [batch_size, auxiliary_channel, h, w]

# From scale_dic = {256: 32, 128: 64, 64: 128}, let's use channel=256
channel = 256
auxiliary_channel = 5
scale_size = 32  # From scale_dic[256] = 32

# Create test tensors
batch_size = 2
x = torch.randn(batch_size, channel, scale_size, scale_size)
auxiliary = torch.randn(batch_size, auxiliary_channel, scale_size, scale_size)

ARGS = {
    "channel": channel,
    "auxiliary_channel": auxiliary_channel,
}
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 ADN — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ADN 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
Attention Ran
ran on a synthesized input
yeates/MMT/modules/MMT.py
code served (permissive licence) · get_code("2886ab71fc45d94b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. 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 torch.nn as nn
import torch.nn.functional as F
import math

class Attention(nn.Module):
    """
    Compute 'Scaled Dot Product Attention
    """

    def forward(self, query, key, value, m=None):
        scores = torch.matmul(query, key.transpose(-2, -1)) / math.sqrt(query.size(-1))
        p_attn = F.softmax(scores, dim=-1)
        p_val = torch.matmul(p_attn, value)
        return (p_val, p_attn)

INIT_ARGS = {}

batch_size = 2
seq_len_q = 5
seq_len_k = 7
d_model = 8

query = torch.randn(batch_size, seq_len_q, d_model)
key = torch.randn(batch_size, seq_len_k, d_model)
value = torch.randn(batch_size, seq_len_k, d_model)

ARGS = {
    'query': query,
    'key': key,
    'value': value,
    'm': None
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
AuxiliaryDecoder Ran
ran on a synthesized input · constructed an object; no result was computed
yeates/MMT/modules/MMT.py
code served (permissive licence) · get_code("6d43d5f3ff129640")
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 an instance of its own class, AuxiliaryDecoder: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'in_channel': 16,
    'out_channel': 32,
    'kernel_size': 3,
    'stride': 1,
    'padding': 1,
    'pred_auxiliary_channel': 8,
    'is_tconv': False,
    'is_pred': True
}
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 AuxiliaryDecoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a AuxiliaryDecoder 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
EdgeProjector Ran
ran on a synthesized input · constructed an object; no result was computed
yeates/MMT/modules/MMT.py
code served (permissive licence) · get_code("34590a5e90d80ef0")
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 an instance of its own class, EdgeProjector: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

# EdgeProjector expects:
# - in_channel: int (number of input channels for TConv)
# - out_channel: int (number of output channels, default=1)

# Looking at the forward method:
# - x comes in with in_channel channels
# - TConv reduces it from in_channel to 64 channels
# - Then x is concatenated with in_image (which has 3 channels for RGB)
# - So gatedConv receives 64 + 3 = 67 channels, which matches the hardcoded 67
# - in_image should be 3-channel (RGB)

# For execution, we need:
# - x: tensor of shape (batch, in_channel, height, width)
# - in_image: tensor of shape (batch, 3, height, width) - should match spatial dims after TConv

in_channel = 16
out_channel = 1
batch_size = 2
height = 8
width = 8

# Create input tensor x with in_channel channels
x = torch.randn(batch_size, in_channel, height, width)

# Create in_image tensor with 3 channels (RGB)
# After TConv with kernel=4, stride=2, padding=1:
# output_height = (height - 1) * 2 + 1 = (8 - 1) * 2 + 1 = 15
# We need to adjust in_image to match. Let's use the output size
in_image = torch.randn(batch_size, 3, 15, 15)

ARGS = {
    "in_channel": in_channel,
    "out_channel": out_channel,
}
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 EdgeProjector — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a EdgeProjector 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
GatedConv2d Ran
ran on a synthesized input · constructed an object; no result was computed
yeates/MMT/modules/MMT.py
code served (permissive licence) · get_code("606f863fb1c77377")
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 an instance of its own class, GatedConv2d: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

# Build a small input tensor for testing
# Shape: (batch=2, channels=3, height=4, width=5)
x = torch.randn(2, 3, 4, 5)

# Define ARGS dict with all parameters for GatedConv2d.__init__
ARGS = {
    'in_channel': 3,
    'out_channel': 8,
    'kernel_size': 3,
    'stride': 1,
    'padding': 1,
    'dilation': 1,
    'is_leaky': True,
    'bias': False,
    'post': False
}
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 GatedConv2d — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GatedConv2d 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
RGBTail Ran
ran on a synthesized input · constructed an object; no result was computed
yeates/MMT/modules/MMT.py
code served (permissive licence) · get_code("a9171680618eb564")
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 an instance of its own class, RGBTail: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

# The RGBTail class expects:
# - inplanes: number of input channels
# - planes: number of intermediate channels
# - stride: stride for the middle convolution (default 1)
# - forward input x: a tensor with shape (batch, inplanes, height, width)

# For a valid forward pass, we need:
# 1. inplanes to match the input tensor's channel dimension
# 2. planes as an intermediate dimension
# 3. stride for the convolution
# 4. Input tensor x with matching channel count

# Create a small input tensor with batch=2, channels=4, height=3, width=3
input_tensor = torch.randn(2, 4, 3, 3)

ARGS = {
    'inplanes': 4,
    'planes': 2,
    'stride': 1
}
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 RGBTail — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a RGBTail 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
SegProjector Ran
ran on a synthesized input
yeates/MMT/modules/MMT.py
code served (permissive licence) · get_code("2faf683ee26d137a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, 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 torch
import torch.nn as nn

class GatedConv2d(nn.Module):

    def __init__(self, in_channel, out_channel, kernel_size, stride=1, padding=0, dilation=1, is_leaky=True, bias=False, post=False):
        super().__init__()
        self.post_processing = post
        self.conv = nn.Conv2d(in_channel, out_channel, kernel_size, stride, padding, dilation, bias=bias)
        self.gate = nn.Conv2d(in_channel, out_channel, kernel_size, stride, padding, dilation, bias=bias)
        self.activation = nn.LeakyReLU(0.2, True) if is_leaky else nn.ReLU(True)
        if post:
            self.post = nn.Sequential(nn.BatchNorm2d(out_channel), nn.ReLU(inplace=True))

    def forward(self, x, m=None):
        feat = self.activation(self.conv(x))
        gating = torch.sigmoid(self.gate(x))
        output = feat * gating
        if self.post_processing:
            output = self.post(output)
        return (output, gating)

class SegProjector(nn.Module):
    """
    output inpainted segmentation.
    """

    def __init__(self, in_channel, out_channel):
        super(SegProjector, self).__init__()
        self.TConv = nn.Sequential(nn.ConvTranspose2d(in_channel, 64, 4, 2, 1), nn.ReLU(True))
        self.gatedConv = GatedConv2d(67, 32, 3, 1, 1, bias=True)
        self.out = nn.Conv2d(32, out_channel, 3, 1, 1)

    def forward(self, x, in_image):
        x = self.TConv(x)
        x, _ = self.gatedConv(torch.cat([x, in_image], axis=1))
        x = self.out(x)
        return x


INIT_ARGS = {
    'in_channel': 16,
    'out_channel': 3,
}

ARGS = {
    'x': torch.randn(2, 16, 8, 8),
    'in_image': torch.randn(2, 3, 16, 16),
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MMTModule Not yet run
unverified (harvested, no recorded run)
yeates/MMT/modules/MMT.py
code served (permissive licence) · get_code("97a17a0e2464e64c")
How it ran

no invocation recorded.

MMTNet Not yet run
unverified (harvested, no recorded run)
yeates/MMT/modules/MMT.py
code served (permissive licence) · get_code("3408132f5f489bc8")
How it ran

no invocation recorded.

MSSA Not yet run
unverified (harvested, no recorded run)
yeates/MMT/modules/MMT.py
code served (permissive licence) · get_code("c88288bf74f4cf29")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 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 11 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-23.

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 is an ill-posed problem to recover missing or damaged image content based on incomplete images with masks. Previous works usually predict the auxiliary structures (e.g., edges, segmentation and contours) to help fill visually realistic patches in a multi-stage fashion. However, imprecise auxiliary priors may yield biased inpainted results. Besides, it is time-consuming for some methods to be implemented by multiple stages of complex neural networks. To solve this issue, we develop an end-to-end multi-modality guided transformer network, including one inpainting branch and two auxiliary branches for semantic segmentation and edge textures. Within each transformer block, the proposed multi-scale spatial-aware attention module can learn the multi-modal structural features efficiently via auxiliary denormalization. Different from previous methods relying on direct guidance from biased priors, our method enriches semantically consistent context in an image based on discriminative interplay information from multiple modalities. Comprehensive experiments on several challenging image inpainting datasets show that our method achieves state-of-the-art performance to deal with various regular/irregular masks efficiently. The code is available at https://github.com/yeates/MMT.

For agents

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

get_harvested_code_for_paper("2208.11844")
get_code_for_paper("2208.11844")
have("2208.11844")

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

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

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

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

Connect an agent — have() is free.