SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2304.03284 · 2023

SegGPT: Segmenting Everything In Context

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 4 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 3 failures of our instrument; 0 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/2304.03284.json · badge: /api/ran/2304.03284.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
baaivision/painter canonical (classifier label)
classifier basis not recorded on the link
10 ran · 0 no recorded run
FunctionStatusWhere it lives
adjust_learning_rate Ran
ran, honoured the contract we drafted
baaivision/painter/Painter/util/lr_sched.py
pointer only (licence: MIT); the stored copy get_code serves, from quandao10/slct, is pointer only (licence: NONE) · get_code("bd3578806ecf5ac2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from quandao10/slct, 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.

build_dataset Ran
ran; our contract draft was wrong, not the code
baaivision/painter/Painter/util/datasets.py
pointer only (licence: MIT); the stored copy get_code serves, from facebookresearch/mae, is pointer only (licence: NOASSERTION) · get_code("27f8c4c706fd43ec")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from facebookresearch/mae, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

build_transform Ran
ran; our contract draft was wrong, not the code
baaivision/painter/Painter/util/datasets.py
pointer only (licence: MIT); the stored copy get_code serves, from facebookresearch/mae, is pointer only (licence: NOASSERTION) · get_code("800cebf161a8aa26")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from facebookresearch/mae, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

collate_fn Ran
ran, honoured the contract we drafted
baaivision/painter/Painter/util/ddp_utils.py
code served (permissive licence) · get_code("f55c31d782e48ffb")
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 list. 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 collate_fn function takes a batch parameter and returns it as-is
# A batch is typically a list of samples from a dataset
# Each sample can be a tuple of (input, target) or just a single item

# Create a simple batch with a few samples
sample1 = (torch.randn(4, 3), torch.tensor(0))
sample2 = (torch.randn(4, 3), torch.tensor(1))

batch = [sample1, sample2]

ARGS = {
    "batch": batch
}
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 list — a list 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
get_layer_id_for_vit Ran
ran, honoured the contract we drafted
baaivision/painter/Painter/util/lr_decay.py
pointer only (licence: MIT); the stored copy get_code serves, from NikolaCenic/ecg-stenosis-cls, is pointer only (licence: NONE) · get_code("89edf5372214b57d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from NikolaCenic/ecg-stenosis-cls, 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.

get_loss_scale_for_deepspeed Ran
ran on a synthesized input
baaivision/painter/Painter/engine_train.py
code served (permissive licence) · get_code("0662163cbe22b24d")
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, ndim 1, 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

torch.manual_seed(0)

class MockOptimizer:
    """Mock optimizer with loss_scale and _global_grad_norm attributes."""
    def __init__(self):
        self.loss_scale = 1024.0
        self._global_grad_norm = 0.5

class MockModel(nn.Module):
    """Minimal model with an optimizer attribute."""
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.optimizer = MockOptimizer()
    
    def forward(self, x):
        return self.linear(x)

# Create a model instance
model = MockModel()

# Define arguments dictionary
ARGS = {
    'model': model
}
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, ndim 1, 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: none by the harness; any seed is in the setup block
get_vit_lr_decay_rate Ran
ran, honoured the contract we drafted
baaivision/painter/Painter/models_painter.py
code served (permissive licence) · get_code("7fd0e9f741ef35d4")
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 float, ndim 0, dtype family float, shape () 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 as nn

torch.manual_seed(0)

# The function takes parameter names and computes lr decay rates
# It doesn't actually need complex objects - just strings and numbers

ARGS = {
    'name': 'backbone.blocks.5.residual.mlp.weight',
    'lr_decay_rate': 0.9,
    'num_layers': 12
}
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 float, ndim 0, dtype family float, shape () — shape () 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
init_distributed_mode Ran
ran on a synthesized input
baaivision/painter/Painter/util/ddp_utils.py
code served (permissive licence) · get_code("b21729609ddb1591")
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 Args. 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 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 os
import torch

# Create a simple args object to hold distributed training parameters
class Args:
    def __init__(self):
        self.rank = 0
        self.world_size = 1
        self.gpu = 0
        self.distributed = False
        self.dist_backend = 'nccl'
        self.dist_url = 'env://'

# Set up environment to avoid distributed initialization
# (since we're in CPU-only mode without actual distributed setup)
if 'RANK' in os.environ:
    del os.environ['RANK']
if 'WORLD_SIZE' in os.environ:
    del os.environ['WORLD_SIZE']
if 'LOCAL_RANK' in os.environ:
    del os.environ['LOCAL_RANK']
if 'SLURM_PROCID' in os.environ:
    del os.environ['SLURM_PROCID']

# Create args object with minimal required attributes
args = Args()

ARGS = {
    'args': args
}
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 Args — a Args output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Args 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
mask_matrix_nms Ran
ran on a synthesized input
baaivision/painter/Painter/util/matrix_nms.py
code served (permissive licence) · get_code("9f23def85e2c60a8")
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)

# Create small sample tensors
num_instances = 2
height = 4
width = 3

# masks: (num_instances, h, w)
masks = torch.randint(0, 2, (num_instances, height, width)).float()

# labels: (num_instances,)
labels = torch.tensor([0, 1], dtype=torch.long)

# scores: (num_instances,)
scores = torch.tensor([0.9, 0.7], dtype=torch.float32)

# filter_thr: float
filter_thr = 0.5

# nms_pre: int
nms_pre = 10

# max_num: int
max_num = 5

# kernel: str
kernel = 'gaussian'

# sigma: float
sigma = 2.0

# mask_area: optional Tensor
mask_area = None

ARGS = {
    'masks': masks,
    'labels': labels,
    'scores': scores,
    'filter_thr': filter_thr,
    'nms_pre': nms_pre,
    'max_num': max_num,
    'kernel': kernel,
    'sigma': sigma,
    'mask_area': mask_area,
}
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
param_groups_lrd Ran
ran; our contract draft was wrong, not the code
baaivision/painter/Painter/util/lr_decay.py
pointer only (licence: MIT); the stored copy get_code serves, from NikolaCenic/ecg-stenosis-cls, is pointer only (licence: NONE) · get_code("8baf25cef41cba16")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from NikolaCenic/ecg-stenosis-cls, 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.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 1 the same month, 7 later) and 3 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
adjust_learning_rate 23 other papers
6 dated earlier, 17 later
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
2204.09435 (2022-04)
Hephaestus: A large scale multitask dataset towards InSAR understanding
2206.07699 (2022-06)
Write and Paint: Generative Vision-Language Models are Unified Modal Learners
and 20 more not named here
build_transform 15 other papers
5 dated earlier, 9 later, 1 same year, order not determinable
2205.03892 (2022-05)
ConvMAE: Masked Convolution Meets Masked Autoencoders
2206.07699 (2022-06)
Write and Paint: Generative Vision-Language Models are Unified Modal Learners
2210.00788 (2022-10)
Towards a Unified View on Visual Parameter-Efficient Transfer Learning
and 12 more not named here
build_dataset 14 other papers
3 dated earlier, 10 later, 1 same year, order not determinable
2205.03892 (2022-05)
ConvMAE: Masked Convolution Meets Masked Autoencoders
2210.00788 (2022-10)
Towards a Unified View on Visual Parameter-Efficient Transfer Learning
aaai_25300 (2023 (year only))
Exploring Stochastic Autoregressive Image Modeling for Visual Representation
and 11 more not named here
param_groups_lrd 14 other papers
3 dated earlier, 10 later, 1 same year, order not determinable
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
2211.12941 (2022-11)
EurNet: Efficient Multi-Range Relational Modeling of Spatial Multi-Relational Data
aaai_25300 (2023 (year only))
Exploring Stochastic Autoregressive Image Modeling for Visual Representation
and 11 more not named here
get_layer_id_for_vit 13 other papers
2 dated earlier, 10 later, 1 same year, order not determinable
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
aaai_25300 (2023 (year only))
Exploring Stochastic Autoregressive Image Modeling for Visual Representation
2301.11445 (2023-01)
3DShape2VecSet: A 3D Shape Representation for Neural Fields and Generative Diffusion Models
and 10 more not named here
collate_fn 6 other papers
1 dated earlier, 1 the same month, 4 later
2107.00860 (2021-07)
Rapid Neural Architecture Search by Learning to Generate Graphs from Datasets
2304.12306 (2023-04)
Segment Anything in Medical Images
2502.00277 (2025-02)
Regularized Langevin Dynamics for Combinatorial Optimization
and 3 more not named here
get_vit_lr_decay_rate 4 other papers
2 dated earlier, 2 later
2207.13080 (2022-07)
DETRs with Hybrid Matching
2212.00280 (2022-12)
GRiT: A Generative Region-to-text Transformer for Object Understanding
2306.04121 (2023-06)
Matte Anything: Interactive Natural Image Matting with Segment Anything Models
and 1 more not named here

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

We present SegGPT, a generalist model for segmenting everything in context. We unify various segmentation tasks into a generalist in-context learning framework that accommodates different kinds of segmentation data by transforming them into the same format of images. The training of SegGPT is formulated as an in-context coloring problem with random color mapping for each data sample. The objective is to accomplish diverse tasks according to the context, rather than relying on specific colors. After training, SegGPT can perform arbitrary segmentation tasks in images or videos via in-context inference, such as object instance, stuff, part, contour, and text. SegGPT is evaluated on a broad range of tasks, including few-shot semantic segmentation, video object segmentation, semantic segmentation, and panoptic segmentation. Our results show strong capabilities in segmenting in-domain and out-of-domain targets, either qualitatively or quantitatively.

For agents

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

get_harvested_code_for_paper("2304.03284")
get_code_for_paper("2304.03284")
have("2304.03284")

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

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

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

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

Connect an agent — have() is free.