SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2108.08291 · ICCV · 2021

Pixel-Perfect Structure-from-Motion with Featuremetric Refinement

Marc Pollefeys, Paul-Edouard Sarlin, Philipp Lindenberger, Viktor Larsson

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 0 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 0 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/2108.08291.json · badge: /api/ran/2108.08291.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
cvg/pixel-perfect-sfm canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
add_ba_args Ran
ran on a synthesized input
cvg/pixel-perfect-sfm/pixsfm/refine_colmap.py
code served (permissive licence) · get_code("b974d72e6b4fdcc1")
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 ArgumentParser. 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 argparse
from pathlib import Path
from unittest.mock import MagicMock

# Create a mock for parse_config_path function
def parse_config_path(path_str):
    return Path(path_str)

# Create mock default_configs
default_configs = ['config1', 'config2']

# Create minimal stand-in subparsers object
class MockSubparsers:
    def add_parser(self, name, aliases=None, help=None):
        parser = argparse.ArgumentParser()
        self.parser = parser
        return parser

# Set up the module-level mocks
import sys
current_module = sys.modules[__name__]
current_module.parse_config_path = parse_config_path
current_module.default_configs = default_configs

# Create test arguments
ARGS = {
    'subparsers': MockSubparsers()
}
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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
extract_patches_numpy Ran
ran on a synthesized input
cvg/pixel-perfect-sfm/pixsfm/features/extract_patches.py
code served (permissive licence) · get_code("c49bebebd2d0d852")
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, 3, 3, 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)

# tensor: torch.Tensor with shape (c, h, w)
# We need h and w to be large enough to accommodate patch extraction
# Let's use c=4 (channels), h=8 (height), w=6 (width) to have distinct dimensions
tensor = torch.randn(4, 8, 6)

# required_corners_np: np.ndarray of shape (num_patches, 2) with corner coordinates
# Each corner is [y, x] position. We need corners within bounds for patch size ps
# Let's use ps=3, so corners should be in range [0, h-ps] and [0, w-ps]
ps = 3
# Create 2 corner positions (batch of 2 patches)
required_corners_np = np.array([[1, 1], [3, 2]], dtype=np.int64)

# ps: int - patch size
# Already defined as ps = 3

ARGS = {
    "tensor": tensor,
    "required_corners_np": required_corners_np,
    "ps": ps,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, packaging, torch — 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, 3, 3, 4) — shape (2, 3, 3, 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
extract_patches_torch Ran
ran on a synthesized input
cvg/pixel-perfect-sfm/pixsfm/features/extract_patches.py
code served (permissive licence) · get_code("34d2e6e6ae9eabec")
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, 2, 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
import numpy as np

torch.manual_seed(0)

# Construct a small 3D tensor: (channels, height, width)
tensor = torch.randn(2, 8, 8)

# Construct required_corners_np as a numpy array of corner coordinates
# Shape should be (num_patches, 2) where each row is (y, x)
required_corners_np = np.array([[0, 0], [2, 2]], dtype=np.int64)

# Patch size
ps = 4

ARGS = {
    'tensor': tensor,
    'required_corners_np': required_corners_np,
    'ps': ps
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, packaging, 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, 2, 4, 4) — shape (2, 2, 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
get_keypoints_and_ids Ran
ran on a synthesized input
cvg/pixel-perfect-sfm/pixsfm/extract.py
code served (permissive licence) · get_code("ed236a1b29462481")
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 numpy as np

torch.manual_seed(0)

# image_name: a string key to index into dictionaries
image_name = "image_001"

# keypoints: a dictionary mapping image names to tensors of shape (num_keypoints, 2)
# We'll create a small example with 5 keypoints, each with 2 coordinates
keypoints = {
    "image_001": torch.tensor([
        [10.0, 20.0],
        [30.0, 40.0],
        [50.0, 60.0],
        [70.0, 80.0],
        [90.0, 100.0]
    ], dtype=torch.float32)
}

# req_keypoint_ids: either None or a dictionary mapping image names to lists/arrays of keypoint indices
# We'll create one that selects keypoints at indices [0, 2, 4]
req_keypoint_ids = {
    "image_001": torch.tensor([0, 2, 4], dtype=torch.long)
}

ARGS = {
    "image_name": image_name,
    "keypoints": keypoints,
    "req_keypoint_ids": req_keypoint_ids
}
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 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
numpy_get_patch Ran
ran on a synthesized input
cvg/pixel-perfect-sfm/pixsfm/features/extract_patches.py
code served (permissive licence) · get_code("d84117ffd35ddabc")
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 (4, 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 numpy as np

torch_seed = 0

# Build arguments for numpy_get_patch
# The function extracts a patch from an array given a corner position and patch size

# Create a 4D array (batch, height, width, channels)
arr_4d = np.random.rand(2, 16, 12, 3)  # batch=2, height=16, width=12, channels=3

# Create a 3D array (height, width, channels)
arr_3d = np.random.rand(10, 8, 4)  # height=10, width=8, channels=4

# Use the 4D array for this example
arr = arr_4d

# Corner position (x, y) - (0, 1) means starting at column 0, row 1
corner = (0, 1)

# Patch size - extract a 4x5 patch
ps = 4

ARGS = {
    "arr": arr,
    "corner": corner,
    "ps": ps
}
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 float, shape (4, 4, 3) — shape (4, 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
write_featuremap_cache_chunked Ran
ran on a synthesized input
cvg/pixel-perfect-sfm/pixsfm/features/store_features.py
code served (permissive licence) · get_code("aa29f90e86b9dcfd")
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 Group. 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 numpy as np
import h5py
import tempfile
import os

# Create a temporary HDF5 file and group for testing
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, 'test.h5')
h5_file = h5py.File(temp_file, 'w')
h5_group = h5_file.create_group('test_group')

# Define the arguments
keypoint_ids = [0, 1, 2, 3, 4]  # List of 5 keypoint IDs
patches = np.random.rand(5, 32, 32, 3).astype(np.float32)  # 5 patches, 32x32, 3 channels
corners = np.random.rand(5, 2).astype(np.float32)  # 5 corners with 2D coordinates
scales = np.random.rand(5).astype(np.float32)  # 5 scale values

metadata = {
    'is_sparse': False,
    'patch_size': 32,
    'descriptor_type': 'test_descriptor',
    'num_keypoints': 5
}

ARGS = {
    'h5_group': h5_group,
    'keypoint_ids': keypoint_ids,
    'patches': patches,
    'corners': corners,
    'scales': scales,
    'metadata': metadata
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
h5py, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Group — a Group output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Group output the recorded ndim 1 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
write_featuremap_cache_grouped Ran
ran on a synthesized input
cvg/pixel-perfect-sfm/pixsfm/features/store_features.py
code served (permissive licence) · get_code("818e4d9ecaa55083")
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 Group. 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 h5py
import numpy as np
import tempfile
import os

# Create a temporary HDF5 file for testing
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.h5")
h5_file = h5py.File(temp_file, "w")
h5_group = h5_file.create_group("featuremap")

# Construct arguments
keypoint_ids = [1, 2]
patches = np.random.randn(2, 4, 3).astype(np.float32)  # 2 patches, 4x3 shape
corners = np.array([[0.1, 0.2], [0.3, 0.4]], dtype=np.float32)  # 2 corners
scales = np.array([[1.0, 2.0], [3.0, 4.0]], dtype=np.float32)  # 2 scales
metadata = {
    'is_sparse': False,
    'resolution': 256,
    'descriptor_dim': 128
}

ARGS = {
    'h5_group': h5_group,
    'keypoint_ids': keypoint_ids,
    'patches': patches,
    'corners': corners,
    'scales': scales,
    'metadata': metadata
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
h5py, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Group — a Group output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Group output the recorded ndim 1 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
write_patch_cache Ran
ran on a synthesized input
cvg/pixel-perfect-sfm/pixsfm/features/store_features.py
code served (permissive licence) · get_code("aae446cffbdf9b03")
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 Dataset. 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 numpy as np
import h5py
import tempfile
import os

# Create a temporary HDF5 file to use as the parent group
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.h5")
h5_file = h5py.File(temp_file, "w")
h5_parent = h5_file.create_group("patches")

# Construct arguments
patch_id = 42
data = np.random.randn(4, 3, 2)  # Small array with distinct dimensions
corner = np.array([1.5, 2.5, 3.5])
scale = np.array([0.1, 0.2, 0.3])

ARGS = {
    "h5_parent": h5_parent,
    "patch_id": patch_id,
    "data": data,
    "corner": corner,
    "scale": scale
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
h5py, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Dataset — a Dataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Dataset output the recorded ndim 3 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
add_ka_args Not yet run
unverified (harvested, no recorded run)
cvg/pixel-perfect-sfm/pixsfm/refine_colmap.py
code served (permissive licence) · get_code("2efd85018b3ebce4")
How it ran

no invocation recorded.

dynamic_load Not yet run
unverified (harvested, no recorded run)
cvg/pixel-perfect-sfm/pixsfm/features/extractor.py
code served (permissive licence) · get_code("85b2e112fce4ef28")
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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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.

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

Finding local features that are repeatable across multiple views is a cornerstone of sparse 3D reconstruction. The classical image matching paradigm detects keypoints per-image once and for all, which can yield poorly-localized features and propagate large errors to the final geometry. In this paper, we refine two key steps of structure-from-motion by a direct alignment of low-level image information from multiple views: we first adjust the initial keypoint locations prior to any geometric estimation, and subsequently refine points and camera poses as a post-processing. This refinement is robust to large detection noise and appearance changes, as it optimizes a featuremetric error based on dense features predicted by a neural network. This significantly improves the accuracy of camera poses and scene geometry for a wide range of keypoint detectors, challenging viewing conditions, and off-the-shelf deep features. Our system easily scales to large image collections, enabling pixel-perfect crowdsourced localization at scale. Our code is publicly available at github.com/cvg/pixel-perfect-sfm as an add-on to the popular SfM software COLMAP.

For agents

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

get_harvested_code_for_paper("2108.08291")
get_code_for_paper("2108.08291")
have("2108.08291")

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

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

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

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

Connect an agent — have() is free.