SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2208.05114 · ECCV · 2022

Ghost-free High Dynamic Range Imaging with Context-aware Transformer

Zhen Liu, Shuaicheng Liu, Bing Zeng, Yinglong Wang

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 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; 0 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2208.05114.json · badge: /api/ran/2208.05114.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
megvii-research/HDR-Transformer canonical (classifier label)
classifier basis not recorded on the link
5 ran · 3 no recorded run
FunctionStatusWhere it lives
batch_psnr Ran
ran on a synthesized input
megvii-research/HDR-Transformer/loss/losses.py
code served (permissive licence) · get_code("a7b3ecd01fd42f74")
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 float64, ndim 0, 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 numpy as np

torch.manual_seed(0)

# Create two small batch tensors with shape (batch_size, channels, height, width)
# batch=2, channels=3, height=4, width=5 to have distinct dimensions
img = torch.randn(2, 3, 4, 5)
imclean = torch.randn(2, 3, 4, 5)

# data_range is typically the maximum value in the image (e.g., 255 for uint8, 1.0 for float)
data_range = 1.0

ARGS = {
    "img": img,
    "imclean": imclean,
    "data_range": data_range
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, skimage, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
fetch_transform Ran
ran on a synthesized input
megvii-research/HDR-Transformer/dataset/transformations.py
code served (permissive licence) · get_code("bbfce380e2b91f46")
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 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 logging

logging.basicConfig(level=logging.INFO)

class MockParams:
    def __init__(self):
        self.transform_type = 'hdr_transformer'

ARGS = {
    'params': MockParams()
}
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 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
flip_sample Ran
ran on a synthesized input
megvii-research/HDR-Transformer/dataset/gen_crop_data.py
code served (permissive licence) · get_code("894888101816dfd4")
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 cv2
import numpy as np

torch_manual_seed_dummy = None

# Create small synthetic image arrays for ldr_0, ldr_1, ldr_2, and label
ldr_0 = np.random.randint(0, 256, (4, 3), dtype=np.uint8)
ldr_1 = np.random.randint(0, 256, (4, 3), dtype=np.uint8)
ldr_2 = np.random.randint(0, 256, (4, 3), dtype=np.uint8)
label = np.random.randint(0, 256, (4, 3), dtype=np.uint8)

data_sample = {
    'ldr_0': ldr_0,
    'ldr_1': ldr_1,
    'ldr_2': ldr_2,
    'label': label,
    'exposure_file_path': '/path/to/exposure.txt'
}

ARGS = {
    'data_sample': data_sample,
    'mode': 0
}
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 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
get_croped_data_per_scene Ran
ran on a synthesized input
megvii-research/HDR-Transformer/dataset/gen_crop_data.py
code served (permissive licence) · get_code("48b29b7d5a67511f")
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 numpy as np
import cv2

# Create a temporary directory structure with necessary files
temp_dir = tempfile.mkdtemp()
scene_dir = os.path.join(temp_dir, 'test_scene')
os.makedirs(scene_dir, exist_ok=True)

# Create exposure.txt file
exposure_file_path = os.path.join(scene_dir, 'exposure.txt')
with open(exposure_file_path, 'w') as f:
    f.write('0.0\n')
    f.write('1.0\n')
    f.write('2.0\n')

# Create three LDR images as .tif files
# Using 256x256 images with 3 channels (BGR format for cv2)
ldr_shape = (256, 256, 3)
ldr_dtype = np.uint8

ldr_0_array = np.random.randint(0, 256, ldr_shape, dtype=ldr_dtype)
ldr_1_array = np.random.randint(0, 256, ldr_shape, dtype=ldr_dtype)
ldr_2_array = np.random.randint(0, 256, ldr_shape, dtype=ldr_dtype)

cv2.imwrite(os.path.join(scene_dir, 'ldr_0.tif'), ldr_0_array)
cv2.imwrite(os.path.join(scene_dir, 'ldr_1.tif'), ldr_1_array)
cv2.imwrite(os.path.join(scene_dir, 'ldr_2.tif'), ldr_2_array)

# Create HDR label image
# cv2.imwrite with .hdr format requires float32 data
hdr_array = np.random.rand(256, 256, 3).astype(np.float32) * 2.0
cv2.imwrite(os.path.join(scene_dir, 'HDRImg.hdr'), hdr_array)

ARGS = {
    'scene_dir': scene_dir,
    'patch_size': 128,
    'stride': 64,
}
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 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
rotate_sample Ran
ran on a synthesized input
megvii-research/HDR-Transformer/dataset/gen_crop_data.py
code served (permissive licence) · get_code("235ee34370d7c9de")
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 cv2
import numpy as np

torch_seed = 0

# Create small dummy images for ldr_0, ldr_1, ldr_2, and label
# These need to be numpy arrays that cv2.rotate can handle
ldr_0 = np.random.randint(0, 256, (4, 3), dtype=np.uint8)
ldr_1 = np.random.randint(0, 256, (4, 3), dtype=np.uint8)
ldr_2 = np.random.randint(0, 256, (4, 3), dtype=np.uint8)
label = np.random.randint(0, 256, (4, 3), dtype=np.uint8)

data_sample = {
    'ldr_0': ldr_0,
    'ldr_1': ldr_1,
    'ldr_2': ldr_2,
    'label': label,
    'exposure_file_path': '/path/to/exposure.txt'
}

ARGS = {
    'data_sample': data_sample,
    'mode': 0
}
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 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
loss_meter_manager_intial Not yet run
unverified (harvested, no recorded run)
megvii-research/HDR-Transformer/common/utils.py
code served (permissive licence) · get_code("6084c0eb4c908f20")
How it ran

no invocation recorded.

window_partition Not yet run
unverified (harvested, no recorded run)
megvii-research/HDR-Transformer/model/hdr_transformer.py
code served (permissive licence) · get_code("73879546dbb5b1b1")
How it ran

no invocation recorded.

window_reverse Not yet run
unverified (harvested, no recorded run)
megvii-research/HDR-Transformer/model/hdr_transformer.py
code served (permissive licence) · get_code("d8fbbb48e7a9bf31")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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, 0 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
loss_meter_manager_intial 1 other paper
1 same year, order not determinable
aaai_20189 (2022 (year only))
FINet: Dual Branches Feature Interaction for Partial-to-Partial Point Cloud Registration
window_partition 1 other paper
1 dated earlier
2111.09883 (2021-11)
Swin Transformer V2: Scaling Up Capacity and Resolution

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

High dynamic range (HDR) deghosting algorithms aim to generate ghost-free HDR images with realistic details. Restricted by the locality of the receptive field, existing CNN-based methods are typically prone to producing ghosting artifacts and intensity distortions in the presence of large motion and severe saturation. In this paper, we propose a novel Context-Aware Vision Transformer (CA-ViT) for ghost-free high dynamic range imaging. The CA-ViT is designed as a dual-branch architecture, which can jointly capture both global and local dependencies. Specifically, the global branch employs a window-based Transformer encoder to model long-range object movements and intensity variations to solve ghosting. For the local branch, we design a local context extractor (LCE) to capture short-range image features and use the channel attention mechanism to select informative local details across the extracted features to complement the global branch. By incorporating the CA-ViT as basic components, we further build the HDR-Transformer, a hierarchical network to reconstruct high-quality ghost-free HDR images. Extensive experiments on three benchmark datasets show that our approach outperforms state-of-the-art methods qualitatively and quantitatively with considerably reduced computational budgets. Codes are available at https://github.com/megvii-research/HDR-Transformer.

For agents

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

get_harvested_code_for_paper("2208.05114")
get_code_for_paper("2208.05114")
have("2208.05114")

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

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

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

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

Connect an agent — have() is free.