SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.15087 · ICCV · 2021

Learning a Sketch Tensor Space for Image Inpainting of Man-made Scenes

Yanwei Fu, Chenjie Cao

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 (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 2 violated it and 0 have no contract verdict; 6 failures of our instrument; 3 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/2103.15087.json · badge: /api/ran/2103.15087.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/MST_inpainting canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
calculate_activation_statistics Ran
ran; our contract draft was wrong, not the code
ewrfcas/MST_inpainting/src/metrics.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/MST_inpainting/src/metrics.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
get_activations Ran
ran; our contract draft was wrong, not the code
ewrfcas/MST_inpainting/src/metrics.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
image_combine Ran
ran, violated the contract we drafted
ewrfcas/MST_inpainting/src/training.py
code served (permissive licence) · get_code("8bd71ae13cacd1a7")
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, 3, 4, 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)

# Create small tensors for image blending operation
# source: the base image
source = torch.rand(2, 3, 4, 4)

# target: the image to blend in
target = torch.rand(2, 3, 4, 4)

# mask: binary mask controlling blend (0 = source, 1 = target)
mask = torch.rand(2, 3, 4, 4)

ARGS = {
    "source": source,
    "target": target,
    "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 4, dtype family float, shape (2, 3, 4, 4) — shape (2, 3, 4, 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
load_model Ran
ran; our contract draft was wrong, not the code
ewrfcas/MST_inpainting/src/training.py
code served (permissive licence) · get_code("f93fa196a0539bce")
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. 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
from unittest.mock import MagicMock, patch
import tempfile
import os

torch.manual_seed(0)

# Create minimal nn.Module instances
class SimpleGenerator(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

class SimpleDiscriminator(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(3, 1)
    
    def forward(self, x):
        return self.linear(x)

# Create a config class
class Config:
    def __init__(self, restore=False, float16=False):
        self.restore = restore
        self.float16 = float16

# Create a model class
class GAN:
    def __init__(self, g_path, d_path, config):
        self.g_path = g_path
        self.d_path = d_path
        self.config = config
        self.g_model = SimpleGenerator()
        self.d_model = SimpleDiscriminator()
        self.g_opt = torch.optim.Adam(self.g_model.parameters())
        self.d_opt = torch.optim.Adam(self.d_model.parameters())
        self.iteration = 0

# Setup - create temporary directory and dummy checkpoint files
temp_dir = tempfile.gettempdir()
g_path_base = os.path.join(temp_dir, 'test_generator')
d_path_base = os.path.join(temp_dir, 'test_discriminator')

# Create checkpoint files for loading
g_checkpoint = {
    'g_model': SimpleGenerator().state_dict(),
    'g_opt': torch.optim.Adam(SimpleGenerator().parameters()).state_dict(),
    'iteration': 42
}
torch.save(g_checkpoint, g_path_base + '_last.pth')

d_checkpoint = {
    'd_model': SimpleDiscriminator().state_dict(),
    'd_opt': torch.optim.Adam(SimpleDiscriminator().parameters()).state_dict(),
    'amp': {}
}
torch.save(d_checkpoint, d_path_base + '_last.pth')

# Create model instance with restore=True to trigger loading
config = Config(restore=True, float16=False)
model = GAN(g_path_base, d_path_base, config)

# Create amp mock
amp = MagicMock()
amp.load_state_dict = MagicMock()

ARGS = {
    'model': model,
    'amp': amp
}
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 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
non_maximum_suppression Ran
ran; our contract draft was wrong, not the code
ewrfcas/MST_inpainting/src/lsm_hawp/detector.py
code served (permissive licence) · get_code("c972983944d63a38")
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, 1, 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)

# The function takes a single parameter 'a' which is used with F.max_pool2d
# F.max_pool2d expects a 4D tensor (batch, channels, height, width)
# Create a small tensor with batch=2, channels=1, height=4, width=3
a = torch.randn(2, 1, 4, 3)

ARGS = {
    "a": a
}
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, 1, 4, 3) — shape (2, 1, 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
resize Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ewrfcas/MST_inpainting/src/model_inference.py
code served (permissive licence) · get_code("efc17d7d22e7bdcf")
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 3, dtype family int, shape (5, 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 cv2
import numpy as np

# Create a small test image with shape (height, width, channels)
# Using distinct dimensions: 8x6x3 (8 height, 6 width, 3 channels for RGB)
img = np.random.randint(0, 256, size=(8, 6, 3), dtype=np.uint8)

ARGS = {
    "img": img,
    "height": 4,
    "width": 5,
    "centerCrop": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (5, 4, 3) — shape (5, 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
to_device Ran
ran; our contract draft was wrong, not the code
ewrfcas/MST_inpainting/lsm_hawp_inference.py
code served (permissive licence) · get_code("3e96ae3d0522cbeb")
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 dict. 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

torch.manual_seed(0)

# Test case 1: Tensor input
tensor_data = torch.randn(2, 4)

# Test case 2: Dict with tensor values
dict_data = {
    "input": torch.randn(2, 4),
    "target": torch.randn(2, 3),
    "mask": torch.randn(2, 5)
}

# Test case 3: List of tensors
list_data = [
    torch.randn(2, 4),
    torch.randn(2, 3),
    torch.randn(2, 5)
]

# Device parameter
device = "cpu"

# Choose one representative case for ARGS
ARGS = {
    "data": dict_data,
    "device": device
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
build_hg Not yet run
unverified (harvested, no recorded run)
ewrfcas/MST_inpainting/src/lsm_hawp/detector.py
code served (permissive licence) · get_code("a5839bdbb6b4c613")
How it ran

no invocation recorded.

get_junctions Not yet run
unverified (harvested, no recorded run)
ewrfcas/MST_inpainting/src/lsm_hawp/detector.py
code served (permissive licence) · get_code("ae550cddf3be9db4")
How it ran

no invocation recorded.

spectral_norm Not yet run
unverified (harvested, no recorded run)
ewrfcas/MST_inpainting/src/layers.py
pointer only (licence: MIT); 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 (MIT), 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 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, 5 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 4 later) and 6 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
3 dated earlier, 11 later · 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
4 later, 1 same year, order not determinable
Guo_Painting_From_Part_ICCV_2021_paper (2021 (year only))
Painting from Part
2203.00867 (2022-03)
Incremental Transformer Structure Enhanced Image Inpainting with Masking Positional Encoding
2210.05950 (2022-10)
ZITS++: Image Inpainting by Improving the Incremental Transformer on Structural Priors
and 2 more not named here
calculate_frechet_distance 3 other papers
3 later
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
2210.05950 (2022-10)
ZITS++: Image Inpainting by Improving the Incremental Transformer on Structural Priors
get_activations 2 other papers
2 later
2203.00867 (2022-03)
Incremental Transformer Structure Enhanced Image Inpainting with Masking Positional Encoding
2210.05950 (2022-10)
ZITS++: Image Inpainting by Improving the Incremental Transformer on Structural Priors
non_maximum_suppression 1 other paper
1 dated earlier
1905.03246 (2019-05)
End-to-End Wireframe Parsing

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

Inputs (b) Exemplar-based (c) GateConv (d) EdgeConnect (e) Ours Figure 1: Results of (b) Exemplar-based inpainting [2], (c) GateConv [43], (d) EdgeConnect [28], and (e) our method, with the inpainted areas highlighted by red dot box. Our method makes better inpainting without artifacts.

For agents

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

get_harvested_code_for_paper("2103.15087")
get_code_for_paper("2103.15087")
have("2103.15087")

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

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

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

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

Connect an agent — have() is free.