SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.00418 · ICLR · 2025

Posterior-Mean Rectified Flow: Towards Minimum MSE Photo-Realistic Image Restoration

Michael Elad, Tomer Michaeli, Guy Ohayon

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 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/2410.00418.json · badge: /api/ran/2410.00418.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
ohayonguy/PMRF canonical (classifier label)
classifier basis: census
7 ran · 3 no recorded run
FunctionStatusWhere it lives
calculate_points Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ohayonguy/PMRF/evaluation/calculate_landmark_distance.py
code served (permissive licence) · get_code("236cf18a7e5a0db9")
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; 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
import torch

torch.manual_seed(0)

# Create a small heatmap tensor with shape (B, N, H, W)
# B=2 (batch size), N=4 (number of keypoints), H=16, W=16 (spatial dimensions)
heatmaps = np.random.rand(2, 4, 16, 16).astype(np.float32)

ARGS = {
    "heatmaps": heatmaps
}
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 float — no output shape is stated: observe_signature.py could not observe it (call:IndexError)
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
conv3x3 Ran
ran; our contract draft was wrong, not the code
ohayonguy/PMRF/evaluation/awing_arch.py
pointer only (licence: MIT); the stored copy get_code serves, from zs7779/FAN_AdaptiveWingLoss, is pointer only (licence: NONE) · get_code("cd28335574411d48")
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 zs7779/FAN_AdaptiveWingLoss, 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.

img2tensor Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ohayonguy/PMRF/evaluation/calculate_cos_dist.py
code served (permissive licence) · get_code("8b5cf3d00508f17b")
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 (3, 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 torch
import numpy as np

torch.manual_seed(0)

# Create a small BGR image as numpy array (height=4, width=3, channels=3)
img_bgr = np.random.randint(0, 256, (4, 3, 3), dtype=np.uint8)

# Create a list of images for testing the list case
imgs_list = [img_bgr, img_bgr.copy()]

# Create single image for testing the single image case
imgs_single = img_bgr

ARGS = {
    "imgs": imgs_single,
    "bgr2rgb": True,
    "float32": True
}
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 3, dtype family float, shape (3, 4, 3) — shape (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
load_image_torch Ran
ran, honoured the contract we drafted
ohayonguy/PMRF/evaluation/calculate_cos_dist.py
code served (permissive licence) · get_code("6d7e52beb54f602e")
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, 1, 128, 128) 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
import torch
from torch.nn import functional as F
from torchvision.transforms.functional import normalize
import tempfile
import os

torch.manual_seed(0)

# Create a minimal valid image file
temp_dir = tempfile.mkdtemp()
img_path = os.path.join(temp_dir, "test_image.jpg")

# Create a small test image (128x128, BGR format, uint8)
test_img = np.random.randint(0, 256, (128, 128, 3), dtype=np.uint8)
cv2.imwrite(img_path, test_img)

ARGS = {
    "img_path": img_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy, torch, torchvision — 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, 1, 128, 128) — shape (1, 1, 128, 128) 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
mesh_grid Ran
ran; our contract draft was wrong, not the code
ohayonguy/PMRF/utils/basicsr_custom.py
pointer only (licence: MIT); the stored copy get_code serves, from SHH-Han/DNF-SR, is pointer only (licence: NOASSERTION) · get_code("794d4f7fc184e7e5")
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 SHH-Han/DNF-SR, and GitHub could not classify the licence of that repository (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.

pdf2 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ohayonguy/PMRF/utils/basicsr_custom.py
pointer only (licence: MIT); the stored copy get_code serves, from SHH-Han/DNF-SR, is pointer only (licence: NOASSERTION) · get_code("321b9c73d589eb9e")
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 SHH-Han/DNF-SR, and GitHub could not classify the licence of that repository (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.

sigma_matrix2 Ran
ran, honoured the contract we drafted
ohayonguy/PMRF/utils/basicsr_custom.py
pointer only (licence: MIT); the stored copy get_code serves, from SHH-Han/DNF-SR, is pointer only (licence: NOASSERTION) · get_code("e3444ff2b9d24600")
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 SHH-Han/DNF-SR, and GitHub could not classify the licence of that repository (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.

calculate_points Not yet run
unverified (harvested, no recorded run)
ohayonguy/PMRF/evaluation/awing_arch.py
code served (permissive licence) · get_code("37e244c7bbaccec7")
How it ran

no invocation recorded.

init_alignment_model Not yet run
unverified (harvested, no recorded run)
ohayonguy/PMRF/evaluation/calculate_landmark_distance.py
code served (permissive licence) · get_code("60130eacf5484058")
How it ran

no invocation recorded.

load_image Not yet run
unverified (harvested, no recorded run)
ohayonguy/PMRF/evaluation/calculate_cos_dist.py
code served (permissive licence) · get_code("d8d6d771a1dadff4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 3 later) and 4 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
mesh_grid 8 other papers
3 dated earlier, 5 later
2310.19011 (2023-10)
Efficient Test-Time Adaptation for Super-Resolution with Second-Order Degradation and Reconstruction
2312.03641 (2023-12)
MotionCtrl: A Unified and Flexible Motion Controller for Video Generation
2403.05049 (2024-03)
XPSR: Cross-modal Priors for Diffusion-based Image Super-Resolution
and 5 more not named here
pdf2 8 other papers
3 dated earlier, 5 later
2310.19011 (2023-10)
Efficient Test-Time Adaptation for Super-Resolution with Second-Order Degradation and Reconstruction
2312.03641 (2023-12)
MotionCtrl: A Unified and Flexible Motion Controller for Video Generation
2403.05049 (2024-03)
XPSR: Cross-modal Priors for Diffusion-based Image Super-Resolution
and 5 more not named here
sigma_matrix2 8 other papers
3 dated earlier, 5 later
2310.19011 (2023-10)
Efficient Test-Time Adaptation for Super-Resolution with Second-Order Degradation and Reconstruction
2312.03641 (2023-12)
MotionCtrl: A Unified and Flexible Motion Controller for Video Generation
2403.05049 (2024-03)
XPSR: Cross-modal Priors for Diffusion-based Image Super-Resolution
and 5 more not named here
img2tensor 3 other papers
3 dated earlier
2309.03020 (2023-09)
SEAL: A Framework for Systematic Evaluation of Real-World Super-Resolution
2407.13987 (2024-07)
RealViformer: Investigating Attention for Real-World Video Super-Resolution
2408.13239 (2024-08)
CustomCrafter: Customized Video Generation with Preserving Motion and Concept Composition Abilities
conv3x3 1 other paper
1 dated earlier
1904.07399 (2019-04)
Adaptive Wing Loss for Robust Face Alignment via Heatmap Regression
load_image 1 other paper
1 dated earlier
2312.15736 (2023-12)
Towards Real-World Blind Face Restoration with Generative Diffusion Prior

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

Photo-realistic image restoration algorithms are typically evaluated by distortion measures (e.g., PSNR, SSIM) and by perceptual quality measures (e.g., FID, NIQE), where the desire is to attain the lowest possible distortion without compromising on perceptual quality. To achieve this goal, current methods commonly attempt to sample from the posterior distribution, or to optimize a weighted sum of a distortion loss (e.g., MSE) and a perceptual quality loss (e.g., GAN). Unlike previous works, this paper is concerned specifically with the optimal estimator that minimizes the MSE under a constraint of perfect perceptual index, namely where the distribution of the reconstructed images is equal to that of the ground-truth ones. A recent theoretical result shows that such an estimator can be constructed by optimally transporting the posterior mean prediction (MMSE estimate) to the distribution of the ground-truth images. Inspired by this result, we introduce Posterior-Mean Rectified Flow (PMRF), a simple yet highly effective algorithm that approximates this optimal estimator. In particular, PMRF first predicts the posterior mean, and then transports the result to a high-quality image using a rectified flow model that approximates the desired optimal transport map. We investigate the theoretical utility of PMRF and demonstrate that it consistently outperforms previous methods on a variety of image restoration tasks.

For agents

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

get_harvested_code_for_paper("2410.00418")
get_code_for_paper("2410.00418")
have("2410.00418")

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

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

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

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

Connect an agent — have() is free.