SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.00680 · CVPR · 2021

LoFTR: Detector-Free Local Feature Matching with Transformers

Hujun Bao, Jiaming Sun, Yuang Wang, Xiaowei Zhou, Zehong Shen

arXiv · PDF · Open in the Atlas

Code that ran

14 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (6 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 8 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/2104.00680.json · badge: /api/ran/2104.00680.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
zju3dv/LoFTR canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
kolkir/coarse_loftr_trt community
Papers with Code archive
10 ran · 2 no recorded run
FunctionStatusWhere it lives
BasicBlock Ran
ran on a synthesized input · constructed an object; no result was computed
kolkir/coarse_loftr_trt/loftr/loftr.py
code served (permissive licence) · get_code("ffe49e7d531de639")
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 an instance of its own class, BasicBlock: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "in_planes": 3,
    "planes": 16,
    "stride": 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BasicBlock — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BasicBlock 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
CoarseMatching Ran
ran on a synthesized input
kolkir/coarse_loftr_trt/loftr/loftr.py
code served (permissive licence) · get_code("0147cf74f675fd9a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple, ndim 4, 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 torch.nn as nn

# Configuration for CoarseMatching
config = {
    'border_rm': 2,
    'dsmax_temperature': 0.1
}

d_size = 8

INIT_ARGS = {
    'config': config,
    'd_size': d_size
}

# Create input tensors for forward pass
# feat_c0: [N, L, C] - batch=2, L=5, C=8
# feat_c1: [N, S, C] - batch=2, S=7, C=8
N = 2
L = 5
S = 7
C = 8

feat_c0 = torch.randn(N, L, C)
feat_c1 = torch.randn(N, S, C)

ARGS = {
    'feat_c0': feat_c0,
    'feat_c1': feat_c1
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
LinearAttention Ran
ran on a synthesized input
kolkir/coarse_loftr_trt/loftr/loftr.py
code served (permissive licence) · get_code("48e8896da53462be")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, 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
from torch.nn import Module, Dropout

def elu_feature_map(x):
    return torch.nn.functional.elu(x) + 1

class LinearAttention(Module):
    def __init__(self, nheads, dim, eps=1e-06):
        super().__init__()
        self.feature_map = elu_feature_map
        self.eps = eps
        self.nheads = nheads
        self.dim = dim

    def forward(self, queries, keys, values):
        Q = self.feature_map(queries)
        K = self.feature_map(keys)
        v_length = values.size(1)
        values = values / v_length
        k = K.view(-1, self.dim).unsqueeze(2)
        v = values.view(-1, self.dim).unsqueeze(1)
        kv = torch.bmm(k, v)
        kv = kv.reshape(-1, v_length, self.nheads, self.dim, self.dim)
        kv = kv.sum(dim=1)
        KV = kv
        k = K.sum(dim=1).unsqueeze(1)
        z = (Q * k).sum(dim=-1)
        z = 1 / (z + self.eps)
        Z = z
        q = Q.unsqueeze(3)
        kv = KV.unsqueeze(1)
        qkv = torch.matmul(q, kv)
        qkv = qkv.squeeze(3)
        qv = qkv * Z.unsqueeze(3)
        qv *= v_length
        queried_values = qv
        return queried_values.contiguous()

INIT_ARGS = {
    'nheads': 2,
    'dim': 4,
    'eps': 1e-06
}

ARGS = {
    'queries': torch.randn(2, 3, 2, 4),
    'keys': torch.randn(2, 5, 2, 4),
    'values': torch.randn(2, 5, 2, 4)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
LoFTREncoderLayer Ran
ran on a synthesized input · constructed an object; no result was computed
kolkir/coarse_loftr_trt/loftr/loftr.py
code served (permissive licence) · get_code("429b87e94184da3a")
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 an instance of its own class, LoFTREncoderLayer: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'batch_size': 2,
    'd_model': 8,
    'nhead': 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LoFTREncoderLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LoFTREncoderLayer 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
LocalFeatureTransformer Ran
ran on a synthesized input · constructed an object; no result was computed
kolkir/coarse_loftr_trt/loftr/loftr.py
code served (permissive licence) · get_code("95375972575e25d1")
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 an instance of its own class, LocalFeatureTransformer: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'batch_size': 2,
    'config': {
        'd_model': 8,
        'nhead': 2,
        'layer_names': ['self', 'cross', 'self']
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LocalFeatureTransformer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LocalFeatureTransformer 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
PositionEncodingSine Ran
ran on a synthesized input · constructed an object; no result was computed
kolkir/coarse_loftr_trt/loftr/loftr.py
code served (permissive licence) · get_code("26afd24b657e30c6")
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 an instance of its own class, PositionEncodingSine: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
import math

torch.manual_seed(0)

class PositionEncodingSine(nn.Module):
    """
    This is a sinusoidal position encoding that generalized to 2-dimensional images
    """

    def __init__(self, d_model, max_shape=(256, 256), temp_bug_fix=True):
        """
        Args:
            max_shape (tuple): for 1/8 featmap, the max length of 256 corresponds to 2048 pixels
            temp_bug_fix (bool): As noted in this [issue](https://github.com/zju3dv/LoFTR/issues/41),
                the original implementation of LoFTR includes a bug in the pos-enc impl, which has little impact
                on the final performance. For now, we keep both impls for backward compatability.
                We will remove the buggy impl after re-training all variants of our released models.
        """
        super().__init__()
        pe = torch.zeros((d_model, *max_shape))
        y_position = torch.ones(max_shape).cumsum(0).float().unsqueeze(0)
        x_position = torch.ones(max_shape).cumsum(1).float().unsqueeze(0)
        if temp_bug_fix:
            div_term = torch.exp(torch.arange(0, d_model // 2, 2).float() * (-math.log(10000.0) / (d_model // 2)))
        else:
            div_term = torch.exp(torch.arange(0, d_model // 2, 2).float() * (-math.log(10000.0) / d_model // 2))
        div_term = div_term[:, None, None]
        pe[0::4, :, :] = torch.sin(x_position * div_term)
        pe[1::4, :, :] = torch.cos(x_position * div_term)
        pe[2::4, :, :] = torch.sin(y_position * div_term)
        pe[3::4, :, :] = torch.cos(y_position * div_term)
        self.register_buffer('pe', pe.unsqueeze(0), persistent=False)

    def forward(self, x):
        """
        Args:
            x: [N, C, H, W]
        """
        return x + self.pe[:, :, :x.size(2), :x.size(3)]


ARGS = {
    'd_model': 4,
    'max_shape': (8, 6),
    'temp_bug_fix': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PositionEncodingSine — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PositionEncodingSine 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
ResNetFPN_16_4 Ran
ran on a synthesized input · constructed an object; no result was computed
kolkir/coarse_loftr_trt/loftr/loftr.py
code served (permissive licence) · get_code("fbee5e0296e8b699")
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 an instance of its own class, ResNetFPN_16_4: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

# Define the helper functions and BasicBlock that are needed
def conv1x1(in_planes, out_planes, stride=1):
    """1x1 convolution without padding"""
    return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, padding=0, bias=False)

def conv3x3(in_planes, out_planes, stride=1):
    """3x3 convolution with padding"""
    return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False)

class BasicBlock(nn.Module):
    def __init__(self, in_planes, planes, stride=1):
        super().__init__()
        self.conv1 = conv3x3(in_planes, planes, stride)
        self.conv2 = conv3x3(planes, planes)
        self.bn1 = nn.BatchNorm2d(planes)
        self.bn2 = nn.BatchNorm2d(planes)
        self.relu = nn.ReLU(inplace=True)
        if stride == 1:
            self.downsample = None
        else:
            self.downsample = nn.Sequential(conv1x1(in_planes, planes, stride=stride), nn.BatchNorm2d(planes))

    def forward(self, x):
        y = x
        y = self.relu(self.bn1(self.conv1(y)))
        y = self.bn2(self.conv2(y))
        if self.downsample is not None:
            x = self.downsample(x)
        return self.relu(x + y)

# Create a valid config dict for ResNetFPN_16_4
config = {
    'initial_dim': 4,
    'block_dims': [8, 16, 32, 64]
}

# Create ARGS dictionary with the single required parameter
ARGS = {
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ResNetFPN_16_4 — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ResNetFPN_16_4 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
ResNetFPN_8_2 Ran
ran on a synthesized input · constructed an object; no result was computed
kolkir/coarse_loftr_trt/loftr/loftr.py
code served (permissive licence) · get_code("73c2839d74b21b14")
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 an instance of its own class, ResNetFPN_8_2: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

# Define the config dictionary for ResNetFPN_8_2
config = {
    'initial_dim': 4,
    'block_dims': [8, 16, 32]
}

# Create a small input tensor (batch=2, channels=1, height=64, width=64)
# This size allows the model to work through all stride=2 layers
input_tensor = torch.randn(2, 1, 64, 64)

ARGS = {
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ResNetFPN_8_2 — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ResNetFPN_8_2 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
compute_max_candidates Ran
ran, honoured the contract we drafted
zju3dv/LoFTR/src/loftr/utils/coarse_matching.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from yuansun-xjtu/icomma, is pointer only (licence: NONE) · get_code("67a8b79fd250e22b")
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 yuansun-xjtu/icomma, 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.

conv1x1 Ran
ran; our contract draft was wrong, not the code
kolkir/coarse_loftr_trt/loftr/loftr.py
code served (permissive licence) · get_code("8ba161d133fcc70b")
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 Conv2d. 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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
zju3dv/LoFTR/src/loftr/backbone/resnet_fpn.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from lixiaotong97/DSU, is pointer only (licence: NONE) · get_code("fac5364e2f53c6db")
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 lixiaotong97/DSU, 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.

elu_feature_map Ran
ran, honoured the contract we drafted
kolkir/coarse_loftr_trt/loftr/loftr.py
code served (permissive licence) · get_code("0d5505bd782b4a89")
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 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

torch.manual_seed(0)

# The function takes a single parameter 'x' which is passed to torch.nn.functional.elu
# and then 1 is added to it. This means x should be a tensor.

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, 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
lower_config Ran
ran; our contract draft was wrong, not the code
zju3dv/LoFTR/src/loftr/utils/cvpr_ds_config.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from ShngJZ/PMatch, is pointer only (licence: NONE) · get_code("616a327f53231192")
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 ShngJZ/PMatch, 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.

warp_kpts Ran
ran; our contract draft was wrong, not the code
zju3dv/LoFTR/src/loftr/utils/geometry.py
code served (permissive licence) · get_code("b8ae61b5c67462ca")
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

torch.manual_seed(0)

# Batch size: 2, number of keypoints: 4, image height: 8, image width: 6
N = 2
L = 4
H = 8
W = 6

# kpts0: [N, L, 2] - keypoint coordinates (x, y)
kpts0 = torch.tensor([
    [[1.5, 2.3], [2.1, 3.4], [3.2, 1.5], [4.5, 5.2]],
    [[0.8, 1.2], [2.3, 4.1], [3.7, 2.8], [1.5, 6.2]]
], dtype=torch.float32)

# depth0: [N, H, W] - depth map for first image
depth0 = torch.rand(N, H, W) * 5.0 + 0.5  # random depths between 0.5 and 5.5
depth0[0, 2, 1] = 2.5  # set depth at keypoint location
depth0[0, 3, 2] = 2.1
depth0[0, 1, 3] = 1.8
depth0[0, 5, 4] = 3.2
depth0[1, 1, 0] = 1.5
depth0[1, 4, 2] = 2.8
depth0[1, 2, 3] = 2.2
depth0[1, 6, 1] = 3.1

# depth1: [N, H, W] - depth map for second image
depth1 = torch.rand(N, H, W) * 5.0 + 0.5
depth1[0, 3, 2] = 2.6  # similar depths for consistency check
depth1[0, 4, 3] = 2.0
depth1[0, 2, 4] = 1.7
depth1[0, 6, 5] = 3.3
depth1[1, 2, 1] = 1.6
depth1[1, 5, 3] = 2.9
depth1[1, 3, 4] = 2.3
depth1[1, 7, 2] = 3.2

# T_0to1: [N, 3, 4] - transformation matrix from frame 0 to frame 1
T_0to1 = torch.eye(4).unsqueeze(0).repeat(N, 1, 1)[:, :3, :]  # identity transform
T_0to1[0, 0, 3] = 0.1  # small translation
T_0to1[1, 1, 3] = 0.05

# K0: [N, 3, 3] - intrinsic matrix for camera 0
K0 = torch.tensor([
    [[500.0, 0.0, 160.0],
     [0.0, 500.0, 120.0],
     [0.0, 0.0, 1.0]],
    [[480.0, 0.0, 160.0],
     [0.0, 480.0, 120.0],
     [0.0, 0.0, 1.0]]
], dtype=torch.float32)

# K1: [N, 3, 3] - intrinsic matrix for camera 1
K1 = torch.tensor([
    [[500.0, 0.0, 160.0],
     [0.0, 500.0, 120.0],
     [0.0, 0.0, 1.0]],
    [[480.0, 0.0, 160.0],
     [0.0, 480.0, 120.0],
     [0.0, 0.0, 1.0]]
], dtype=torch.float32)

ARGS = {
    "kpts0": kpts0,
    "depth0": depth0,
    "depth1": depth1,
    "T_0to1": T_0to1,
    "K0": K0,
    "K1": K1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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
LoFTR Not yet run
unverified (harvested, no recorded run)
kolkir/coarse_loftr_trt/loftr/loftr.py
code served (permissive licence) · get_code("83ecec9f333726dc")
How it ran

no invocation recorded.

build_backbone Not yet run
unverified (harvested, no recorded run)
kolkir/coarse_loftr_trt/loftr/loftr.py
code served (permissive licence) · get_code("7031281c61f439e7")
How it ran

no invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
conv3x3
brick of this paper's assembly: helper
686 other papers
285 dated earlier, 19 the same month, 376 later, 6 same year, order not determinable · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
conv1x1
brick of this paper's assembly: helper
16 other papers
2 dated earlier, 14 later · 1 only as an assembly brick
2003.00707 (2020-03)
Unbiased Mean Teacher for Cross-domain Object Detection
2007.03815 (2020-07)
Real-time Semantic Segmentation with Fast Attention
2112.05006 (2021-12)
Exploring Event-driven Dynamic Context for Accident Scene Segmentation
and 13 more not named here
elu_feature_map
brick of this paper's assembly: helper
14 other papers
14 later · 2 only as an assembly brick
2203.09645 (2022-03)
MatchFormer: Interleaving Attention in Transformers for Feature Matching
2203.10981 (2022-03)
MonoDTR: Monocular 3D Object Detection with Depth-Aware Transformer
2203.11483 (2022-03)
Practical Stereo Matching via Cascaded Recurrent Network with Adaptive Correlation
and 11 more not named here
compute_max_candidates 5 other papers
5 later
2203.09645 (2022-03)
MatchFormer: Interleaving Attention in Transformers for Feature Matching
2204.10144 (2022-04)
A case for using rotation invariant features in state of the art feature matchers
2312.09031 (2023-12)
iComMa: Inverting 3D Gaussian Splatting for Camera Pose Estimation via Comparing and Matching
and 2 more not named here
lower_config 4 other papers
4 later
2204.10144 (2022-04)
A case for using rotation invariant features in state of the art feature matchers
2209.12213 (2022-09)
ECO-TR: Efficient Correspondences Finding Via Coarse-to-Fine Refinement
2303.17342 (2023-03)
PMatch: Paired Masked Image Modeling for Dense Geometric Matching
and 1 more not named here
warp_kpts 2 other papers
2 later
2402.02800 (2024-02)
Extreme Two-View Geometry From Object Poses with Diffusion Models
2404.09692 (2024-04)
XoFTR: Cross-modal Feature Matching Transformer

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 novel method for local image feature matching. Instead of performing image feature detection, description, and matching sequentially, we propose to first establish pixel-wise dense matches at a coarse level and later refine the good matches at a fine level. In contrast to dense methods that use a cost volume to search correspondences, we use self and cross attention layers in Transformer to obtain feature descriptors that are conditioned on both images. The global receptive field provided by Transformer enables our method to produce dense matches in low-texture areas, where feature detectors usually struggle to produce repeatable interest points. The experiments on indoor and outdoor datasets show that LoFTR outperforms state-of-the-art methods by a large margin. LoFTR also ranks first on two public benchmarks of visual localization among the published methods.

For agents

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

get_harvested_code_for_paper("2104.00680")
get_code_for_paper("2104.00680")
have("2104.00680")

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

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

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

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

Connect an agent — have() is free.