SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1909.06581 · 2019

Blind Super-Resolution Kernel Estimation using an Internal-GAN

arXiv · PDF · Open in the Atlas

Code that ran

10 of 12 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; 1 honoured the contract we drafted, 1 violated it and 4 have no contract verdict; 4 failures of our instrument; 2 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/1909.06581.json · badge: /api/ran/1909.06581.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
Lornatang/KernelGAN community (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
BillOuyang/KernelGan-s3 reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
contributions Ran
ran, honoured the contract we drafted
Lornatang/KernelGAN/imresize.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from toummHus/HAIR, is pointer only (licence: NONE) · get_code("b921438690ac017f")
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 toummHus/HAIR, 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.

downscale Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
BillOuyang/KernelGan-s3/datagenerator/generator.py
pointer only (licence: NOASSERTION) · get_code("2c3537174371eb3d")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, BillOuyang/KernelGan-s3 (NOASSERTION). 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.

fix_scale_and_size Ran
ran, violated the contract we drafted
Lornatang/KernelGAN/imresize.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from toummHus/HAIR, is pointer only (licence: NONE) · get_code("ee75635bb6c497f1")
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 toummHus/HAIR, 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.

gen_kernel Ran
ran; our contract draft was wrong, not the code
BillOuyang/KernelGan-s3/datagenerator/generator.py
pointer only (licence: NOASSERTION) · get_code("2b6d632ae7409fb5")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, BillOuyang/KernelGan-s3 (NOASSERTION). 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.

im2tensor Ran
ran on a synthesized input
Lornatang/KernelGAN/util.py
code served (permissive licence) · get_code("9cb8c14a5a5d6d3b")
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 (1, 3, 4, 3) 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 numpy as np

torch.manual_seed(0)

# The function im2tensor expects a numpy array representing an image
# It should have shape (height, width, channels) with 3 channels (RGB)
# The function transposes it to (channels, height, width) format
# and normalizes it to [-1, 1] range

# Create a small test image as uint8 numpy array
# Shape: (height=4, width=3, channels=3) - distinct dimensions
im_np = np.random.randint(0, 256, size=(4, 3, 3), dtype=np.uint8)

ARGS = {
    "im_np": im_np
}
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 Tensor, ndim 4, dtype family float, shape (1, 3, 4, 3) — shape (1, 3, 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
imresize Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Lornatang/KernelGAN/imresize.py
code served (permissive licence) · get_code("7b064b7f22f1a281")
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 float, shape (8, 6, 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
from scipy.ndimage import filters, measurements, interpolation
from math import pi

# Create a small test image (4x3x3: height x width x channels)
test_image = np.random.rand(4, 3, 3).astype(np.float32)

# Define the ARGS dictionary with all parameters for imresize
ARGS = {
    'im': test_image,
    'scale_factor': 2.0,
    'output_shape': None,
    'kernel': None,
    'antialiasing': True,
    'kernel_shift_flag': False
}
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 ndarray, ndim 3, dtype family float, shape (8, 6, 3) — shape (8, 6, 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
kernel_shift Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
BillOuyang/KernelGan-s3/datagenerator/generator.py
pointer only (licence: NOASSERTION) · get_code("247be28fb1025380")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, BillOuyang/KernelGan-s3 (NOASSERTION). 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.

move2cpu Ran
ran on a synthesized input
Lornatang/KernelGAN/util.py
code served (permissive licence) · get_code("ae7a590467df97d5")
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 (2, 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
import numpy as np

torch.manual_seed(0)

# The function move2cpu expects a tensor on GPU (or CPU)
# It calls: .detach(), .cpu(), .float(), .numpy()
# These are all standard tensor methods

# Create a small tensor to pass as argument
d = torch.randn(2, 4, dtype=torch.float32)

ARGS = {
    "d": d
}
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 ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
random_augment Ran
ran on a synthesized input
Lornatang/KernelGAN/ZSSRforKernelGAN/zssr_utils.py
code served (permissive licence) · get_code("1b0a3179c34cf2e7")
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 3, 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 numpy as np
from math import pi, sin, cos
from cv2 import warpPerspective, INTER_CUBIC

np.random.seed(0)

# Create small test images with distinct dimensions
im1 = np.random.rand(64, 80).astype(np.float32)  # 64x80
im1 = np.clip(im1, 0, 1)

im2 = np.random.rand(32, 40).astype(np.float32)  # 32x40
im2 = np.clip(im2, 0, 1)

ims = [im1, im2]

# Create corresponding loss maps with same dimensions
loss_map1 = np.random.rand(64, 80).astype(np.float32)
loss_map1 = np.clip(loss_map1, 0, 1)

loss_map2 = np.random.rand(32, 40).astype(np.float32)
loss_map2 = np.clip(loss_map2, 0, 1)

loss_map_sources = [loss_map1, loss_map2]

ARGS = {
    'ims': ims,
    'base_scales': None,
    'leave_as_is_probability': 0.2,
    'no_interpolate_probability': 0.3,
    'min_scale': 0.5,
    'max_scale': 1.0,
    'allow_rotation': True,
    'scale_diff_sigma': 0.01,
    'shear_sigma': 0.01,
    'crop_size': 128,
    'allow_scale_in_no_interp': False,
    'crop_center': None,
    'loss_map_sources': loss_map_sources,
}
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 tuple, ndim 3, 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
tensor2im Ran
ran on a synthesized input
Lornatang/KernelGAN/util.py
code served (permissive licence) · get_code("7a4d057c155883e4")
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 (4, 5, 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 numpy as np

torch.manual_seed(0)

# Create a small tensor that matches what tensor2im expects
# The function expects: im_t with shape (batch, channels, height, width)
# It will squeeze(0) to remove batch dim, then transpose to (height, width, channels)
# So we need shape (1, 3, 4, 5) for (batch=1, channels=3, height=4, width=5)
im_tensor = torch.randn(1, 3, 4, 5)

ARGS = {
    "im_t": im_tensor
}
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 ndarray, ndim 3, dtype family int, shape (4, 5, 3) — shape (4, 5, 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
kernel_shift Not yet run
unverified (harvested, no recorded run)
Lornatang/KernelGAN/ZSSRforKernelGAN/zssr_utils.py
code served (permissive licence) · get_code("aebde4515b49a7ab")
How it ran

no invocation recorded.

preprocess_kernels Not yet run
unverified (harvested, no recorded run)
Lornatang/KernelGAN/ZSSRforKernelGAN/zssr_utils.py
code served (permissive licence) · get_code("ce5184edff18c76c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 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.

FunctionAlso present inEarliest-datedOthers named
contributions 4 other papers
4 later
2403.14614 (2024-03)
AdaIR: Adaptive All-in-One Image Restoration via Frequency Mining and Modulation
2404.02154 (2024-04)
Dynamic Pre-training: Towards Efficient and Scalable All-in-One Image Restoration
2405.17074 (2024-05)
Towards Ultra-High-Definition Image Deraining: A Benchmark and An Efficient Method
and 1 more not named here
fix_scale_and_size 4 other papers
4 later
2403.14614 (2024-03)
AdaIR: Adaptive All-in-One Image Restoration via Frequency Mining and Modulation
2404.02154 (2024-04)
Dynamic Pre-training: Towards Efficient and Scalable All-in-One Image Restoration
2405.17074 (2024-05)
Towards Ultra-High-Definition Image Deraining: A Benchmark and An Efficient Method
and 1 more not named here
imresize 4 other papers
4 later
2403.14614 (2024-03)
AdaIR: Adaptive All-in-One Image Restoration via Frequency Mining and Modulation
2404.02154 (2024-04)
Dynamic Pre-training: Towards Efficient and Scalable All-in-One Image Restoration
2405.17074 (2024-05)
Towards Ultra-High-Definition Image Deraining: A Benchmark and An Efficient Method
and 1 more not named here

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

Super resolution (SR) methods typically assume that the low-resolution (LR) image was downscaled from the unknown high-resolution (HR) image by a fixed 'ideal' downscaling kernel (e.g. Bicubic downscaling). However, this is rarely the case in real LR images, in contrast to synthetically generated SR datasets. When the assumed downscaling kernel deviates from the true one, the performance of SR methods significantly deteriorates. This gave rise to Blind-SR - namely, SR when the downscaling kernel ("SR-kernel") is unknown. It was further shown that the true SR-kernel is the one that maximizes the recurrence of patches across scales of the LR image. In this paper we show how this powerful cross-scale recurrence property can be realized using Deep Internal Learning. We introduce "KernelGAN", an image-specific Internal-GAN, which trains solely on the LR test image at test time, and learns its internal distribution of patches. Its Generator is trained to produce a downscaled version of the LR test image, such that its Discriminator cannot distinguish between the patch distribution of the downscaled image, and the patch distribution of the original LR image. The Generator, once trained, constitutes the downscaling operation with the correct image-specific SR-kernel. KernelGAN is fully unsupervised, requires no training data other than the input image itself, and leads to state-of-the-art results in Blind-SR when plugged into existing SR algorithms.

For agents

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

get_harvested_code_for_paper("1909.06581")
get_code_for_paper("1909.06581")
have("1909.06581")

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

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

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

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

Connect an agent — have() is free.