SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1806.03589 · 2018

Free-Form Image Inpainting with Gated Convolution

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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 5 have no contract verdict; 2 failures of our instrument; 0 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/1806.03589.json · badge: /api/ran/1806.03589.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
pfnet-research/Chainer-DeepFill community (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
csqiangwen/DeepFillv2_Pytorch community (classifier label)
classifier basis not recorded on the link
2 ran · 0 no recorded run
SayedNadim/Free_Form_Image_Inpainting_Gated_Conv community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
FunctionStatusWhere it lives
batch_postprocess_images Ran
ran on a synthesized input
pfnet-research/Chainer-DeepFill/src/utils.py
code served (permissive licence) · get_code("4caf963a3beebcf2")
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 (8, 15, 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 numpy as np

# Create a small test image batch
# img shape should be (batch_total, channels, width, height)
# We need at least batch_w * batch_h elements in the first dimension
batch_w = 2
batch_h = 3
channels = 3
width = 4
height = 5

# Create an image array with shape (6, 3, 4, 5) where 6 = 2*3
img = np.random.randn(batch_w * batch_h, channels, width, height).astype(np.float32)

ARGS = {
    "img": img,
    "batch_w": batch_w,
    "batch_h": batch_h,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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 (8, 15, 3) — shape (8, 15, 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
bbox2mask Ran
ran on a synthesized input
pfnet-research/Chainer-DeepFill/src/inpaint_ops.py
code served (permissive licence) · get_code("74b8bbb02eed8073")
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 4, dtype family float, shape (2, 1, 64, 48) 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

class Config:
    IMG_SHAPES = (64, 48)
    MAX_DELTA_HEIGHT = 8
    MAX_DELTA_WIDTH = 6

bbox = (10, 8, 30, 20)
batchsize = 2
config = Config()
xp = np

ARGS = {
    "bbox": bbox,
    "batchsize": batchsize,
    "config": config,
    "xp": xp
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 4, dtype family float, shape (2, 1, 64, 48) — shape (2, 1, 64, 48) 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
dataset_files Ran
ran on a synthesized input
SayedNadim/Free_Form_Image_Inpainting_Gated_Conv/flist_maker.py
code served (permissive licence) · get_code("d6d0565ac9e754d3")
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 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.

import os
import tempfile
import fnmatch

# Create a temporary directory with some test files
tmpdir = tempfile.mkdtemp()

# Create some subdirectories and files
os.makedirs(os.path.join(tmpdir, "subdir1"), exist_ok=True)
os.makedirs(os.path.join(tmpdir, "subdir2"), exist_ok=True)

# Create test files matching various patterns
open(os.path.join(tmpdir, "image1.jpg"), "w").close()
open(os.path.join(tmpdir, "image2.png"), "w").close()
open(os.path.join(tmpdir, "data.txt"), "w").close()
open(os.path.join(tmpdir, "subdir1", "image3.jpg"), "w").close()
open(os.path.join(tmpdir, "subdir1", "photo.png"), "w").close()
open(os.path.join(tmpdir, "subdir2", "image4.jpg"), "w").close()

ARGS = {
    "rootdir": tmpdir,
    "pattern": "*.jpg"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
free_form_mask Ran
ran on a synthesized input
pfnet-research/Chainer-DeepFill/src/inpaint_ops.py
code served (permissive licence) · get_code("5e0f61f83bc68c0f")
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, 256, 256) 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 random
import cv2
import numpy as np
import torch

# Create a stand-in class for xp that supports the array() method
class XPModule:
    def array(self, data, dtype=None):
        # Convert numpy array to torch tensor
        if isinstance(data, np.ndarray):
            return torch.from_numpy(data).float()
        return torch.tensor(data, dtype=torch.float32)

xp_instance = XPModule()

ARGS = {
    'xp': xp_instance,
    'batchsize': 2,
    'size': (256, 256),
    'maxVertex': 20,
    'minLength': 50,
    'maxLength': 200,
    'minBrushWidth': 10,
    'maxBrushWidth': 40,
    'maxAngle': 20
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy, 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, 256, 256) — shape (2, 1, 256, 256) 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
l2normalize Ran
ran; our contract draft was wrong, not the code
csqiangwen/DeepFillv2_Pytorch/network_module.py
pointer only (licence: MIT); the stored copy get_code serves, from xxxliu95/RA_FA_Cardiac, is pointer only (licence: NONE) · get_code("bedff51745d2cf84")
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 xxxliu95/RA_FA_Cardiac, 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.

random_bbox Ran
ran on a synthesized input
pfnet-research/Chainer-DeepFill/src/inpaint_ops.py
code served (permissive licence) · get_code("06995870b9c8a9ae")
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 int; 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 random

class Config:
    def __init__(self):
        self.IMG_SHAPES = (480, 640)
        self.VERTICAL_MARGIN = 10
        self.HEIGHT = 100
        self.HORIZONTAL_MARGIN = 20
        self.WIDTH = 150

config = Config()

ARGS = {
    "config": config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 1, dtype family int — 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
text_readlines Ran
ran; our contract draft was wrong, not the code
csqiangwen/DeepFillv2_Pytorch/utils.py
code served (permissive licence) · get_code("2c0f9420e07c7b34")
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 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.

import tempfile
import os

# Create a temporary text file with some content
with tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt') as f:
    temp_filename = f.name
    f.write("line one\n")
    f.write("line two\n")
    f.write("line three\n")

ARGS = {
    'filename': temp_filename
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 5 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
l2normalize 27 other papers
2 dated earlier, 25 later · 2 only as an assembly brick
1703.09452 (2017-03)
SEGAN: Speech Enhancement Generative Adversarial Network
1802.05957 (2018-02)
Spectral Normalization for Generative Adversarial Networks
1810.08771 (2018-10)
Image Inpainting via Generative Multi-column Convolutional Neural Networks
and 24 more not named here
text_readlines 2 other papers
2 later
2104.12357 (2021-04)
VCGAN: Video Colorization with Hybrid Generative Adversarial Network
2303.11591 (2023-03)
SVCNet: Scribble-based Video Colorization Network with Temporal Aggregation

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

We present a generative image inpainting system to complete images with free-form mask and guidance. The system is based on gated convolutions learned from millions of images without additional labelling efforts. The proposed gated convolution solves the issue of vanilla convolution that treats all input pixels as valid ones, generalizes partial convolution by providing a learnable dynamic feature selection mechanism for each channel at each spatial location across all layers. Moreover, as free-form masks may appear anywhere in images with any shape, global and local GANs designed for a single rectangular mask are not applicable. Thus, we also present a patch-based GAN loss, named SN-PatchGAN, by applying spectral-normalized discriminator on dense image patches. SN-PatchGAN is simple in formulation, fast and stable in training. Results on automatic image inpainting and user-guided extension demonstrate that our system generates higher-quality and more flexible results than previous methods. Our system helps user quickly remove distracting objects, modify image layouts, clear watermarks and edit faces. Code, demo and models are available at: https://github.com/JiahuiYu/generative_inpainting

For agents

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

get_harvested_code_for_paper("1806.03589")
get_code_for_paper("1806.03589")
have("1806.03589")

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

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

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

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

Connect an agent — have() is free.