SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.14432 · NeurIPS · 2021

TransMatcher: Deep Image Matching Through Transformers for Generalizable Person Re-identification

Ling Shao, Shengcai Liao

arXiv · PDF · Open in the Atlas

Code that ran

13 of 21 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 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; 5 failures of our instrument; 8 no recorded run), measured 2026-11-21; 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/2105.14432.json · badge: /api/ran/2105.14432.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
ShengcaiLiao/QAConv canonical (classifier label)
classifier basis: census
3 ran · 3 no recorded run
ShengcaiLiao/TransMatcher canonical (classifier label)
classifier basis: classifier_2025
1 ran · 2 no recorded run
JDAI-CV/fast-reid community
Papers with Code archive
7 ran · 1 no recorded run
shengcailiao/QAConv community
Papers with Code archive
1 ran · 2 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
Block Ran
ran on a synthesized input · constructed an object; no result was computed
JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py
code served (permissive licence) · get_code("ce093271c9f68c89")
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, Block: 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 = {
    "dim": 64,
    "num_heads": 8,
    "mlp_ratio": 4.0,
    "qkv_bias": False,
    "qk_scale": None,
    "drop": 0.1,
    "attn_drop": 0.1,
    "drop_path": 0.1,
    "act_layer": nn.GELU,
    "norm_layer": nn.LayerNorm,
}
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 Block — 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 Block 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
DropPath Ran
ran on a synthesized input · constructed an object; no result was computed
JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py
code served (permissive licence) · get_code("75f5c156267fccbd")
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, DropPath: 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)

# The DropPath class only takes one parameter: drop_prob
# It's used in forward() which passes it to drop_path function
# drop_prob should be a float or None (default)

ARGS = {
    "drop_prob": 0.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 DropPath — 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 DropPath 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
HybridEmbed Ran
ran on a synthesized input · constructed an object; no result was computed
JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py
code served (permissive licence) · get_code("719c7757b5d6beae")
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, HybridEmbed: 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
from collections import namedtuple

torch.manual_seed(0)

# Create a minimal backbone CNN that returns a feature map
class MinimalBackbone(nn.Module):
    def __init__(self):
        super().__init__()
        # Simple conv layer that outputs feature maps
        # Input: (B, 3, 224, 224) -> Output: (B, 64, 56, 56)
        self.conv = nn.Conv2d(3, 64, kernel_size=4, stride=4)
        self.num_features = 64
    
    def forward(self, x):
        return self.conv(x)

# Create the backbone instance
backbone = MinimalBackbone()

ARGS = {
    'backbone': backbone,
    'img_size': 224,
    'feature_size': None,
    'in_chans': 3,
    'embed_dim': 768,
}
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 HybridEmbed — 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 HybridEmbed 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
PatchEmbed_overlap Ran
ran on a synthesized input · constructed an object; no result was computed
JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py
code served (permissive licence) · get_code("9cd956aee362b467")
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, PatchEmbed_overlap: 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
import collections.abc
from itertools import repeat

torch.manual_seed(0)

def _ntuple(n):
    def parse(x):
        if isinstance(x, collections.abc.Iterable):
            return x
        return tuple(repeat(x, n))
    return parse

to_2tuple = _ntuple(2)

class PatchEmbed_overlap(nn.Module):
    """ Image to Patch Embedding with overlapping patches
    """

    def __init__(self, img_size=224, patch_size=16, stride_size=20, in_chans=3, embed_dim=768):
        super().__init__()
        img_size = to_2tuple(img_size)
        patch_size = to_2tuple(patch_size)
        stride_size_tuple = to_2tuple(stride_size)
        self.num_x = (img_size[1] - patch_size[1]) // stride_size_tuple[1] + 1
        self.num_y = (img_size[0] - patch_size[0]) // stride_size_tuple[0] + 1
        num_patches = self.num_x * self.num_y
        self.img_size = img_size
        self.patch_size = patch_size
        self.num_patches = num_patches
        self.proj = nn.Conv2d(in_chans, embed_dim, kernel_size=patch_size, stride=stride_size)
        for m in self.modules():
            if isinstance(m, nn.Conv2d):
                n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels
                m.weight.data.normal_(0, math.sqrt(2.0 / n))
            elif isinstance(m, nn.BatchNorm2d):
                m.weight.data.fill_(1)
                m.bias.data.zero_()
            elif isinstance(m, nn.InstanceNorm2d):
                m.weight.data.fill_(1)
                m.bias.data.zero_()

    def forward(self, x):
        B, C, H, W = x.shape
        assert H == self.img_size[0] and W == self.img_size[1], f"Input image size ({H}*{W}) doesn't match model ({self.img_size[0]}*{self.img_size[1]})."
        x = self.proj(x)
        x = x.flatten(2).transpose(1, 2)
        return x

ARGS = {
    'img_size': 64,
    'patch_size': 8,
    'stride_size': 4,
    'in_chans': 3,
    'embed_dim': 32
}
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 PatchEmbed_overlap — 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 PatchEmbed_overlap 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
TransformerDecoderLayer Ran
ran on a synthesized input
shengcailiao/QAConv/projects/transmatcher/transmatcher.py
code served (permissive licence) · get_code("700a80fe0d60b57f")
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 2, 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 import nn
from torch import Tensor
from torch.nn.modules import Module
from torch import einsum

class TransformerDecoderLayer(Module):
    """TransformerDecoderLayer is made up of feature matching and feedforward network.

    Args:
        d_model: the number of expected features in the input (required).
        dim_feedforward: the dimension of the feedforward network model (default=2048).

    Examples::
        >>> decoder_layer = TransformerDecoderLayer(d_model=512, dim_feedforward=2048)
        >>> memory = torch.rand(10, 24, 8, 512)
        >>> tgt = torch.rand(20, 24, 8, 512)
        >>> out = decoder_layer(tgt, memory)
    """

    def __init__(self, seq_len, d_model=512, dim_feedforward=2048):
        super(TransformerDecoderLayer, self).__init__()
        self.seq_len = seq_len
        self.d_model = d_model
        score_embed = torch.randn(seq_len, seq_len)
        score_embed = score_embed + score_embed.t()
        self.score_embed = nn.Parameter(score_embed.view(1, 1, seq_len, seq_len))
        self.fc1 = nn.Linear(d_model, d_model)
        self.bn1 = nn.BatchNorm1d(1)
        self.fc2 = nn.Linear(self.seq_len, dim_feedforward)
        self.bn2 = nn.BatchNorm1d(dim_feedforward)
        self.relu = nn.ReLU()
        self.fc3 = nn.Linear(dim_feedforward, 1)
        self.bn3 = nn.BatchNorm1d(1)

    def forward(self, tgt: Tensor, memory: Tensor) -> Tensor:
        """Pass the inputs through the decoder layer.

        Args:
            tgt: the sequence to the decoder layer (required).
            memory: the sequence from the last layer of the encoder (required).

        Shape:
            tgt: [q, h, w, d], where q is the query length, d is d_model, and (h, w) is feature map size
            memory: [k, h, w, d], where k is the memory length
        """
        q, h, w, d = tgt.size()
        assert h * w == self.seq_len and d == self.d_model
        k, h, w, d = memory.size()
        assert h * w == self.seq_len and d == self.d_model
        tgt = tgt.view(q, -1, d)
        memory = memory.view(k, -1, d)
        query = self.fc1(tgt)
        key = self.fc1(memory)
        score = einsum('q t d, k s d -> q k s t', query, key) * self.score_embed.sigmoid()
        score = score.reshape(q * k, self.seq_len, self.seq_len)
        score = torch.cat((score.max(dim=1)[0], score.max(dim=2)[0]), dim=-1)
        score = score.view(-1, 1, self.seq_len)
        score = self.bn1(score).view(-1, self.seq_len)
        score = self.fc2(score)
        score = self.bn2(score)
        score = self.relu(score)
        score = self.fc3(score)
        score = score.view(-1, 2).sum(dim=-1, keepdim=True)
        score = self.bn3(score)
        score = score.view(q, k)
        return score


INIT_ARGS = {
    'seq_len': 6,
    'd_model': 4,
    'dim_feedforward': 8,
}

ARGS = {
    'tgt': torch.randn(2, 2, 3, 4),
    'memory': torch.randn(3, 2, 3, 4),
}

if __name__ == '__main__':
    decoder_layer = TransformerDecoderLayer(**INIT_ARGS)
    output = decoder_layer(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
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 2, 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)
TransformerDecoderLayer Ran
ran on a synthesized input
ShengcaiLiao/TransMatcher/matching/transmatcher_match.py
code served (permissive licence) · get_code("28e208cc3e5212ed")
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. 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
from torch import nn

INIT_ARGS = {
    "seq_len": 6,  # 2x3 spatial grid
    "d_model": 4,  # tiny feature dimension
    "dim_feedforward": 8,  # small feedforward dimension
}

# Construct tensors for forward call
batch_q = 2  # query batch
batch_k = 3  # memory batch
h, w = 2, 3  # spatial height and width
d = INIT_ARGS["d_model"]

tgt = torch.randn(batch_q, h, w, d)  # query tensor
memory = torch.randn(batch_k, h, w, d)  # memory tensor

ARGS = {
    "tgt": tgt,
    "memory": memory,
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
_no_grad_trunc_normal_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py
code served (permissive licence) · get_code("813ed3a96c17cf42")
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) 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
import math

torch.manual_seed(0)

# Create a small tensor to be initialized
tensor = torch.empty(2, 4)

# Define parameters for truncated normal distribution
mean = 0.0
std = 1.0
a = -2.0  # lower bound
b = 2.0   # upper bound

ARGS = {
    "tensor": tensor,
    "mean": mean,
    "std": std,
    "a": a,
    "b": b,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
_ntuple Ran
ran; our contract draft was wrong, not the code
JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py
code served (permissive licence) · get_code("019554bbb3a9809d")
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 function. 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 collections.abc
from itertools import repeat
import torch

def _ntuple(n):
    def parse(x):
        if isinstance(x, collections.abc.Iterable):
            return x
        return tuple(repeat(x, n))
    return parse

# The function _ntuple takes a single parameter 'n' (an integer)
# and returns a parse function that converts iterables to themselves
# and non-iterables to tuples of repeated elements

torch.manual_seed(0)

ARGS = {
    "n": 3
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
create Ran
ran; our contract draft was wrong, not the code
ShengcaiLiao/QAConv/reid/models/resmap.py
code served (permissive licence) · get_code("6a5b9f52cf3678a2")
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 ResNet. 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
from torch import nn
import torchvision

torch.manual_seed(0)

ARGS = {
    'name': 'resnet50',
    'pretrained': False,
    'final_layer': 'layer3',
    'neck': 128
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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
drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from fudan-zvg/SeaFormer
pointer only; the stored copy get_code serves, from fudan-zvg/SeaFormer, is pointer only (licence: NONE) · get_code("3ac6b7d76e8e3584")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

extract_features Ran
ran on a synthesized input
ShengcaiLiao/QAConv/reid/evaluators.py
code served (permissive licence) · get_code("31d7e2c3ae921a59")
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 (8, 5, 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 torch.nn as nn
from torch.utils.data import DataLoader, Dataset

torch.manual_seed(0)

# Build a minimal CNN model that outputs the expected feature shape
class MiniCNN(nn.Module):
    def __init__(self, num_features, fea_height, fea_width):
        super().__init__()
        self.num_features = num_features
        self.fea_height = fea_height
        self.fea_width = fea_width
        self.conv = nn.Conv2d(3, num_features, kernel_size=1)
    
    def forward(self, x):
        # x shape: (batch, 3, H, W)
        # Output shape: (batch, num_features, fea_height, fea_width)
        batch_size = x.shape[0]
        return torch.randn(batch_size, self.num_features, self.fea_height, self.fea_width, device=x.device, dtype=x.dtype)

# Build a minimal dataset
class MiniDataset(Dataset):
    def __init__(self, num_samples=8):
        self.num_samples = num_samples
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        # Return (imgs, _, _, _) as expected by the data loader iteration
        imgs = torch.randn(3, 16, 16)  # 3 channels, 16x16 image
        dummy1 = torch.tensor(0)
        dummy2 = torch.tensor(0)
        dummy3 = torch.tensor(0)
        return imgs, dummy1, dummy2, dummy3

# Create model
num_features = 5
fea_height = 4
fea_width = 3
model = MiniCNN(num_features, fea_height, fea_width)

# Create data loader
dataset = MiniDataset(num_samples=8)
data_loader = DataLoader(dataset, batch_size=2, shuffle=False)

# Construct ARGS dictionary
ARGS = {
    "model": model,
    "data_loader": data_loader,
    "num_features": num_features,
    "fea_height": fea_height,
    "fea_width": fea_width,
    "verbose": False
}
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 4, dtype family float, shape (8, 5, 4, 3) — shape (8, 5, 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
pre_tlift Ran
ran on a synthesized input
ShengcaiLiao/QAConv/reid/evaluators.py
code served (permissive licence) · get_code("cf997e855309b9ea")
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 numpy as np

# The function expects gallery and query to be iterables of tuples
# where each tuple is (item1, item2, cam_id, frame_time)
# The function unpacks these tuples and extracts cam_id and frame_time

gallery = [
    (0, 1, 0, 100.0),
    (1, 2, 1, 101.0),
    (2, 3, 2, 102.0),
]

query = [
    (3, 4, 1, 200.0),
    (4, 5, 0, 201.0),
]

ARGS = {
    'gallery': gallery,
    'query': query,
}
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 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
trunc_normal_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py
code served (permissive licence) · get_code("605878f6dcef72e9")
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) 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
import math

torch.manual_seed(0)

# Create a small tensor to be filled with truncated normal values
tensor = torch.empty(2, 4)

# Define arguments for trunc_normal_
ARGS = {
    'tensor': tensor,
    'mean': 0.0,
    'std': 1.0,
    'a': -2.0,
    'b': 2.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
TLift Not yet run
unverified (harvested, no recorded run)
ShengcaiLiao/QAConv/reid/tlift.py
code served (permissive licence) · get_code("7632194fce63925e")
How it ran

no invocation recorded.

TransMatcher Not yet run
unverified (harvested, no recorded run)
shengcailiao/QAConv/projects/transmatcher/transmatcher.py
code served (permissive licence) · get_code("33abed14c194aba1")
How it ran

no invocation recorded.

TransMatcher Not yet run
unverified (harvested, no recorded run)
ShengcaiLiao/TransMatcher/matching/transmatcher_match.py
code served (permissive licence) · get_code("d616a6fa60f095d2")
How it ran

no invocation recorded.

TransformerDecoder Not yet run
unverified (harvested, no recorded run)
shengcailiao/QAConv/projects/transmatcher/transmatcher.py
code served (permissive licence) · get_code("9366a0f55adb1a1b")
How it ran

no invocation recorded.

TransformerDecoder Not yet run
unverified (harvested, no recorded run)
ShengcaiLiao/TransMatcher/matching/transmatcher_match.py
code served (permissive licence) · get_code("a7701d0fcf35a63a")
How it ran

no invocation recorded.

VisionTransformer Not yet run
unverified (harvested, no recorded run)
JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py
code served (permissive licence) · get_code("9368e7f2101c9a30")
How it ran

no invocation recorded.

create Not yet run
unverified (harvested, no recorded run)
ShengcaiLiao/QAConv/projects/transmatcher/restranmap.py
code served (permissive licence) · get_code("10c6466fe43af640")
How it ran

no invocation recorded.

extract_cnn_feature Not yet run
unverified (harvested, no recorded run)
ShengcaiLiao/QAConv/reid/evaluators.py
code served (permissive licence) · get_code("124a181591c811ba")
How it ran

no invocation recorded.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 20 distinct functions with an identity, 10 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 0 the same month, 8 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
drop_path
brick of this paper's assembly: helper
224 other papers
5 dated earlier, 218 later, 1 undated · 38 only as an assembly brick
2003.12039 (2020-03)
RAFT: Recurrent All-Pairs Field Transforms for Optical Flow
2007.09384 (2020-07)
Multi-Scale Positive Sample Refinement for Few-Shot Object Detection
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
and 221 more not named here
trunc_normal_
brick of this paper's assembly: helper
160 other papers
7 dated earlier, 153 later · 36 only as an assembly brick
1911.10194 (2019-11)
Panoptic-DeepLab: A Simple, Strong, and Fast Baseline for Bottom-Up Panoptic Segmentation
2005.10242 (2020-05)
Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
2007.12911 (2020-07)
Tighter risk certificates for neural networks
and 157 more not named here
DropPath
brick of this paper's assembly: helper
47 other papers
2 dated earlier, 45 later · 33 only as an assembly brick
2003.12039 (2020-03)
RAFT: Recurrent All-Pairs Field Transforms for Optical Flow
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2108.10257 (2021-08)
SwinIR: Image Restoration Using Swin Transformer
and 44 more not named here
_no_grad_trunc_normal_
brick of this paper's assembly: helper
44 other papers
1 dated earlier, 43 later · 38 only as an assembly brick
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2106.08254 (2021-06)
BEIT: BERT Pre-Training of Image Transformers
2110.13430 (2021-10)
Contextual Similarity Aggregation with Self-attention for Visual Re-ranking
and 41 more not named here
_ntuple
brick of this paper's assembly: helper
20 other papers
1 dated earlier, 19 later · 18 only as an assembly brick
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
2108.10257 (2021-08)
SwinIR: Image Restoration Using Swin Transformer
2203.11335 (2022-03)
Global Matching with Overlapping Attention for Optical Flow Estimation
and 17 more not named here
Block
brick of this paper's assembly: model
12 other papers
4 dated earlier, 8 later · 4 only as an assembly brick
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2101.11986 (2021-01)
Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet
2103.10455 (2021-03)
3D Human Pose Estimation with Spatial and Temporal Transformers
and 9 more not named here
HybridEmbed
brick of this paper's assembly: model
6 other papers
6 later · 3 only as an assembly brick
2106.02034 (2021-06)
DynamicViT: Efficient Vision Transformers with Dynamic Token Sparsification
2303.13755 (2023-03)
Sparsifiner: Learning Sparse Instance-Dependent Attention for Efficient Vision Transformers
2308.03322 (2023-08)
Part-Aware Transformer for Generalizable Person Re-identification
and 3 more not named here
PatchEmbed_overlap
brick of this paper's assembly: model
2 other papers
2 later · 2 only as an assembly brick
2403.14513 (2024-03)
View-decoupled Transformer for Person Re-identification under Aerial-ground Camera Network
2503.06965 (2025-03)
SeCap: Self-Calibrating and Adaptive Prompts for Cross-view Person Re-Identification in Aerial-Ground Networks
create 1 other paper
1 dated earlier
2006.12774 (2020-06)
Surpassing Real-World Source Training Data: Random 3D Characters for Generalizable Person Re-Identification
pre_tlift 1 other paper
1 dated earlier
2006.12774 (2020-06)
Surpassing Real-World Source Training Data: Random 3D Characters for Generalizable Person Re-Identification

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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Transformers have recently gained increasing attention in computer vision. However, existing studies mostly use Transformers for feature representation learning, e.g. for image classification and dense predictions, and the generalizability of Transformers is unknown. In this work, we further investigate the possibility of applying Transformers for image matching and metric learning given pairs of images. We find that the Vision Transformer (ViT) and the vanilla Transformer with decoders are not adequate for image matching due to their lack of image-to-image attention. Thus, we further design two naive solutions, i.e. query-gallery concatenation in ViT, and query-gallery cross-attention in the vanilla Transformer. The latter improves the performance, but it is still limited. This implies that the attention mechanism in Transformers is primarily designed for global feature aggregation, which is not naturally suitable for image matching. Accordingly, we propose a new simplified decoder, which drops the full attention implementation with the softmax weighting, keeping only the query-key similarity computation. Additionally, global max pooling and a multilayer perceptron (MLP) head are applied to decode the matching result. This way, the simplified decoder is computationally more efficient, while at the same time more effective for image matching. The proposed method, called TransMatcher, achieves state-of-the-art performance in generalizable person re-identification, with up to 6.1% and 5.7% performance gains in Rank-1 and mAP, respectively, on several popular datasets. Code is available at https://github.com/ShengcaiLiao/QAConv.

For agents

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

get_harvested_code_for_paper("2105.14432")
get_code_for_paper("2105.14432")
have("2105.14432")

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

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

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

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

Connect an agent — have() is free.