SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.05633 · ICCV · 2021

Segmenter: Transformer for Semantic Segmentation

Cordelia Schmid, Robin Strudel, Ricardo Garcia, Ivan Laptev Inria

arXiv · PDF · Open in the Atlas

Code that ran

4 of 7 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 3 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2105.05633.json · badge: /api/ran/2105.05633.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
tue-mps/cts-segmenter community (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
isaaccorley/segmenter-pytorch community
Papers with Code archive
0 ran · 3 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tue-mps/cts-segmenter/segm/metrics.py
code served (permissive licence) · get_code("2cc3699f9a695af9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 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

torch.manual_seed(0)

# Construct arguments for the accuracy function
# The function expects:
# - output: tensor of shape (batch_size, num_classes) with logits/scores
# - target: tensor of shape (batch_size,) with class indices
# - topk: tuple of integers specifying which top-k accuracies to compute

batch_size = 2
num_classes = 4

# output: logits tensor of shape (batch_size, num_classes)
output = torch.randn(batch_size, num_classes)

# target: ground truth class indices of shape (batch_size,)
target = torch.tensor([0, 2])

# topk: tuple of k values to compute accuracy for
topk = (1, 2)

ARGS = {
    "output": output,
    "target": target,
    "topk": topk
}
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 list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
policy_gt_gen Ran
ran on a synthesized input
tue-mps/cts-segmenter/policynet/policynet/data_ade20k.py
code served (permissive licence) · get_code("59c2c15636de4edc")
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 int, shape (2, 2) 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 torch.nn.functional as F

torch.manual_seed(0)

# Create a small ground truth tensor (H=8, W=8)
gt = torch.randint(0, 10, (8, 8)).long()

# Define patch_size
patch_size = 2

# Define boolean flags
group_if_all_ignore = True
ignore_if_one_class_plus_ignore = False
ignore_if_one_class_plus_ignore_border = False

ARGS = {
    "gt": gt,
    "patch_size": patch_size,
    "group_if_all_ignore": group_if_all_ignore,
    "ignore_if_one_class_plus_ignore": ignore_if_one_class_plus_ignore,
    "ignore_if_one_class_plus_ignore_border": ignore_if_one_class_plus_ignore_border,
}
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 int, shape (2, 2) — shape (2, 2) 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
policy_gt_gen Ran
ran on a synthesized input
tue-mps/cts-segmenter/policynet/policynet/data_cityscapes.py
code served (permissive licence) · get_code("4b5dbae992d30d9f")
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 int, shape (1, 1) 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 torch.nn.functional as F

torch.manual_seed(0)

# Create a small ground truth tensor with semantic segmentation labels
# Shape: (H, W) where H and W are small dimensions
# Values can be class labels (0-254) or 255 (ignore label)
gt = torch.tensor([
    [0, 1, 2, 255],
    [0, 1, 2, 255],
    [3, 3, 3, 255],
    [3, 3, 3, 255]
], dtype=torch.int32)

# patch_size parameter - controls the pooling patch size
# The function will multiply this by 2 internally
patch_size = 2

# group_if_all_ignore - boolean flag
group_if_all_ignore = True

# ignore_if_one_class_plus_ignore - boolean flag
ignore_if_one_class_plus_ignore = False

ARGS = {
    "gt": gt,
    "patch_size": patch_size,
    "group_if_all_ignore": group_if_all_ignore,
    "ignore_if_one_class_plus_ignore": ignore_if_one_class_plus_ignore,
}
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 int, shape (1, 1) — shape (1, 1) 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
policy_gt_gen Ran
ran on a synthesized input
tue-mps/cts-segmenter/policynet/policynet/data_pcontext.py
code served (permissive licence) · get_code("22ec93cd607fd71b")
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 int, shape (2, 1) 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 torch.nn.functional as F

torch.manual_seed(0)

# Create a small ground truth tensor (H, W)
# The function expects a 2D tensor and will unsqueeze it to (1, H, W)
gt = torch.randint(0, 10, (8, 6), dtype=torch.int64)

# patch_size should be a positive integer
patch_size = 2

# Boolean flags
group_if_all_ignore = True
ignore_if_one_class_plus_ignore = False

ARGS = {
    "gt": gt,
    "patch_size": patch_size,
    "group_if_all_ignore": group_if_all_ignore,
    "ignore_if_one_class_plus_ignore": ignore_if_one_class_plus_ignore,
}
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 int, shape (2, 1) — shape (2, 1) 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
MaskTransformer Not yet run
unverified (harvested, no recorded run)
isaaccorley/segmenter-pytorch/segmenter/segmenter.py
code served (permissive licence) · get_code("aae0d919d8e77e3d")
How it ran

no invocation recorded.

Segmenter Not yet run
unverified (harvested, no recorded run)
isaaccorley/segmenter-pytorch/segmenter/segmenter.py
code served (permissive licence) · get_code("61186cac81f07daa")
How it ran

no invocation recorded.

Upsample Not yet run
unverified (harvested, no recorded run)
isaaccorley/segmenter-pytorch/segmenter/segmenter.py
code served (permissive licence) · get_code("92364877f3ee8bbb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
accuracy 3 other papers
3 later
2406.09936 (2024-06)
ALGM: Adaptive Local-then-Global Token Merging for Efficient Semantic Segmentation with Plain Vision Transformers
2412.10569 (2024-12)
Learning to Merge Tokens via Decoupled Embedding for Efficient Vision Transformers

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

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

Abstract

Image segmentation is often ambiguous at the level of individual image patches and requires contextual information to reach label consensus. In this paper we introduce Segmenter, a transformer model for semantic segmentation. In contrast to convolution-based methods, our approach allows to model global context already at the first layer and throughout the network. We build on the recent Vision Transformer (ViT) and extend it to semantic segmentation. To do so, we rely on the output embeddings corresponding to image patches and obtain class labels from these embeddings with a point-wise linear decoder or a mask transformer decoder. We leverage models pre-trained for image classification and show that we can fine-tune them on moderate sized datasets available for semantic segmentation. The linear decoder allows to obtain excellent results already, but the performance can be further improved by a mask transformer generating class masks. We conduct an extensive ablation study to show the impact of the different parameters, in particular the performance is better for large models and small patch sizes. Segmenter attains excellent results for semantic segmentation. It outperforms the state of the art on both ADE20K and Pascal Context datasets and is competitive on Cityscapes.

For agents

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

get_harvested_code_for_paper("2105.05633")
get_code_for_paper("2105.05633")
have("2105.05633")

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

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

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

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

Connect an agent — have() is free.