SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.17154 · ICCV · 2021

Learning Spatio-Temporal Transformer for Visual Tracking

Houwen Peng, Jianlong Fu, Dong Wang, Huchuan Lu, Bin Yan

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-21; 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/2103.17154.json · badge: /api/ran/2103.17154.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
researchmm/Stark marked official in Papers with Code
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
STARKS Ran
ran on a synthesized input · constructed an object; no result was computed
researchmm/Stark/lib/models/stark/stark_st.py
code served (permissive licence) · get_code("e0e7fdca5502018f")
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, STARKS: 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
from torch import nn
import torch.nn.functional as F

torch.manual_seed(0)

# Mock backbone
class MockBackbone(nn.Module):
    def __init__(self):
        super().__init__()
        self.num_channels = 3
        self.conv = nn.Conv2d(3, 256, kernel_size=1)
    
    def forward(self, nested_tensor):
        tensors = nested_tensor.tensors  # [B, 3, H, W]
        mask = nested_tensor.mask  # [B, H, W]
        feat = self.conv(tensors)  # [B, 256, H, W]
        pos = nn.Parameter(torch.randn(1, 256, feat.shape[2], feat.shape[3]))
        nested_feat = NestedTensor(feat, mask)
        return [nested_feat], [pos]

# Mock transformer
class MockTransformer(nn.Module):
    def __init__(self, d_model=256):
        super().__init__()
        self.d_model = d_model
        self.linear = nn.Linear(d_model, d_model)
    
    def forward(self, feat, mask, query_embed, pos, return_encoder_output=False):
        # feat: [HW, B, C]
        B = feat.shape[1]
        num_queries = query_embed.shape[0]
        # decoder output: [1, B, num_queries, C]
        hs = self.linear(feat[:, :, :self.d_model]).unsqueeze(0)[:, :, :num_queries, :]
        enc_mem = feat
        if return_encoder_output:
            return hs, enc_mem
        return hs

# Mock box head
class MockBoxHead(nn.Module):
    def __init__(self, feat_sz=4):
        super().__init__()
        self.feat_sz = feat_sz
        self.conv = nn.Conv2d(256, 4, kernel_size=1)
    
    def forward(self, x):
        # x: [*, 256, feat_sz, feat_sz]
        return self.conv(x)  # [*, 4, feat_sz, feat_sz]

# NestedTensor class
class NestedTensor(object):
    def __init__(self, tensors, mask=None):
        self.tensors = tensors
        self.mask = mask
    
    def to(self, device):
        cast_tensor = self.tensors.to(device)
        cast_mask = self.mask.to(device) if self.mask is not None else None
        return NestedTensor(cast_tensor, cast_mask)
    
    def decompose(self):
        return (self.tensors, self.mask)
    
    def __repr__(self):
        return str(self.tensors)

# Helper box function
def box_xyxy_to_cxcywh(x):
    x0, y0, x1, y1 = x.unbind(-1)
    b = [(x0 + x1) / 2, (y0 + y1) / 2, x1 - x0, y1 - y0]
    return torch.stack(b, dim=-1)

# Create instances
backbone = MockBackbone()
transformer = MockTransformer(d_model=256)
box_head = MockBoxHead(feat_sz=4)
num_queries = 2

ARGS = {
    'backbone': backbone,
    'transformer': transformer,
    'box_head': box_head,
    'num_queries': num_queries,
    'aux_loss': False,
    'head_type': 'CORNER'
}
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 STARKS — 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 STARKS 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
STARKST Ran
ran on a synthesized input · constructed an object; no result was computed
researchmm/Stark/lib/models/stark/stark_st.py
code served (permissive licence) · get_code("e6d94dbe64913e22")
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, STARKST: 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
from torch import nn
from typing import Optional, List
from torch import Tensor

torch.manual_seed(0)

class DummyBackbone(nn.Module):
    def __init__(self):
        super().__init__()
        self.num_channels = 3
        self.conv = nn.Conv2d(3, 4, 1)
    
    def forward(self, nested_tensor):
        x = nested_tensor.tensors
        x = self.conv(x)
        mask = nested_tensor.mask
        output = NestedTensor(x, mask)
        pos_embed = NestedTensor(torch.randn(x.size(0), 4, x.size(2), x.size(3)), mask)
        return [output], [pos_embed]

class DummyTransformer(nn.Module):
    def __init__(self, d_model=4):
        super().__init__()
        self.d_model = d_model
        self.linear = nn.Linear(d_model, d_model)
    
    def forward(self, feat, mask, query_embed, pos, return_encoder_output=False):
        # feat shape: (HW, B, C)
        # query_embed shape: (N, C)
        B = feat.size(1)
        N = query_embed.size(0)
        output_embed = self.linear(feat).unsqueeze(0).expand(1, B, -1, -1)
        enc_mem = feat
        if return_encoder_output:
            return output_embed, enc_mem
        return output_embed

class DummyBoxHead(nn.Module):
    def __init__(self, feat_sz=2):
        super().__init__()
        self.feat_sz = feat_sz
        self.conv = nn.Conv2d(4, 4, 3, padding=1)
    
    def forward(self, x):
        x = self.conv(x)
        x = x.flatten(1)
        batch_size = x.size(0)
        num_queries = batch_size // (self.feat_sz ** 2)
        x = x.view(num_queries, batch_size // num_queries, 4)
        x = x.view(-1, 4)
        coords = torch.clamp(x, 0, 1)
        return coords.view(-1, 4)

class NestedTensor(object):
    def __init__(self, tensors, mask: Optional[Tensor]):
        self.tensors = tensors
        self.mask = mask

    def to(self, device):
        cast_tensor = self.tensors.to(device)
        mask = self.mask
        if mask is not None:
            assert mask is not None
            cast_mask = mask.to(device)
        else:
            cast_mask = None
        return NestedTensor(cast_tensor, cast_mask)

    def decompose(self):
        return (self.tensors, self.mask)

    def __repr__(self):
        return str(self.tensors)

backbone = DummyBackbone()
transformer = DummyTransformer(d_model=4)
box_head = DummyBoxHead(feat_sz=2)
num_queries = 4

ARGS = {
    'backbone': backbone,
    'transformer': transformer,
    'box_head': box_head,
    'num_queries': num_queries,
    'aux_loss': False,
    'head_type': 'CORNER'
}
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 STARKST — 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 STARKST 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

Also present in other papers' code

Of 2 samples lifted from this paper's linked repositories, 2 carry a function identity and 0 do not. Of the 2 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 2 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-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

In this paper, we present a new tracking architecture with an encoder-decoder transformer as the key component. The encoder models the global spatio-temporal feature dependencies between target objects and search regions, while the decoder learns a query embedding to predict the spatial positions of the target objects. Our method casts object tracking as a direct bounding box prediction problem, without using any proposals or predefined anchors. With the encoder-decoder transformer, the prediction of objects just uses a simple fully-convolutional network, which estimates the corners of objects directly. The whole method is end-to-end, does not need any postprocessing steps such as cosine window and bounding box smoothing, thus largely simplifying existing tracking pipelines. The proposed tracker achieves state-of-the-art performance on multiple challenging short-term and long-term benchmarks, while running at real-time speed, being 6× faster than Siam R-CNN [54]. Code and models are open-sourced at https://github.com/researchmm/Stark. * Work performed when Bin Yan was an intern of MSRA.

For agents

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

get_harvested_code_for_paper("2103.17154")
get_code_for_paper("2103.17154")
have("2103.17154")

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

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

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

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

Connect an agent — have() is free.