SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.22624 · 2025

Seg-R1: Segmentation Can Be Surprisingly Simple with Reinforcement Learning

arXiv · PDF · Open in the Atlas

Code that ran

22 of 23 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; 3 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 16 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/2506.22624.json · badge: /api/ran/2506.22624.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
geshang777/Seg-R1 canonical (classifier label)
classifier basis: classifier_2025
6 ran · 0 no recorded run
geshang777/FOCUS community (classifier label)
classifier basis not recorded on the link
16 ran · 1 no recorded run
FunctionStatusWhere it lives
batch_dice_loss Ran
ran; our contract draft was wrong, not the code
geshang777/FOCUS/focus/modeling/matcher.py
code served (permissive licence) · get_code("bc2cb481a75c370d")
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, 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

torch.manual_seed(0)

# Create small tensors for inputs and targets
# inputs: arbitrary shape float tensor (predictions)
# targets: same shape as inputs, binary classification labels (0 or 1)
# Using shape (2, 4) - batch size 2, 4 features
inputs = torch.randn(2, 4, dtype=torch.float32)
targets = torch.randint(0, 2, (2, 4), dtype=torch.float32)

ARGS = {
    'inputs': inputs,
    'targets': targets,
}
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, 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
calculate_uncertainty Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
geshang777/FOCUS/focus/modeling/criterion.py
code served (permissive licence) · get_code("2dcb8123d89bb1ff")
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 (2, 1, 4, 3) 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)

# logits should be a tensor of shape (R, 1, ...) where R is number of predictions
# The function expects logits.shape[1] == 1
# Let's create a tensor with shape (2, 1, 4, 3) - R=2, C=1, and spatial dims 4x3
logits = torch.randn(2, 1, 4, 3)

ARGS = {
    "logits": logits
}
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 (2, 1, 4, 3) — shape (2, 1, 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
compute_num_params Ran
ran, honoured the contract we drafted
geshang777/FOCUS/focus/evaluation/utils.py
code served (permissive licence) · get_code("8b40bb3f5347ccd5")
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 int, ndim 0, dtype family int, 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
import numpy as np

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model,
    "text": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
crop_with_mask Ran
ran; our contract draft was wrong, not the code
geshang777/FOCUS/focus/modeling/clip_refiner/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from workforai/scan, is pointer only (licence: NOASSERTION) · get_code("4b40d7fecc852bbe")
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 workforai/scan, 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.

cross_entropy Ran
ran; our contract draft was wrong, not the code
geshang777/FOCUS/focus/modeling/matcher.py
code served (permissive licence) · get_code("63e6e57b587c3aa8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 1, dtype family float, shape (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

torch.manual_seed(0)

# Create predictions tensor (batch_size=2, num_classes=4)
# These are logits (pre-softmax values)
preds = torch.randn(2, 4)

# Create targets tensor (batch_size=2, num_classes=4)
# These should be probability distributions (sum to 1 along dim 1)
targets = torch.softmax(torch.randn(2, 4), dim=1)

# reduction parameter
reduction = 'none'

ARGS = {
    'preds': preds,
    'targets': targets,
    'reduction': reduction
}
Setup block drafted by
a language model, Claude Sonnet 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 1, dtype family float, shape (2,) — shape (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
deform_inputs Ran
ran on a synthesized input
geshang777/FOCUS/focus/modeling/edge_enhancer/edge_enhancer.py
code served (permissive licence) · get_code("16369aff5471aa71")
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)

# The function deform_inputs takes x (a tensor) and patch_size (an integer)
# x needs shape (bs, c, h, w) where bs=batch size, c=channels, h=height, w=width
# patch_size is used to divide h and w

# Create a small input tensor
# Let's use: batch_size=2, channels=4, height=64, width=64
x = torch.randn(2, 4, 64, 64)

# patch_size should be a divisor of h and w
# Using patch_size=8 works well with h=64, w=64
patch_size = 8

ARGS = {
    "x": x,
    "patch_size": patch_size,
}
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
dice_loss Ran
ran; our contract draft was wrong, not the code
geshang777/FOCUS/focus/modeling/criterion.py
code served (permissive licence) · get_code("89f75e54ff128be0")
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 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

torch.manual_seed(0)

# Create small tensors for inputs and targets
# inputs should be arbitrary shape that can be flattened
inputs = torch.randn(2, 4, requires_grad=False)  # batch_size=2, features=4
targets = torch.randint(0, 2, (2, 4), dtype=torch.float32)  # same shape as inputs, binary labels

# num_masks is a float representing the number of masks for normalization
num_masks = 2.0

ARGS = {
    "inputs": inputs,
    "targets": targets,
    "num_masks": num_masks,
}
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 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
drop_path Ran
ran on a synthesized input
geshang777/FOCUS/focus/modeling/edge_enhancer/edge_enhancer.py
code served (permissive licence) · get_code("4134f673786a2abe")
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)

# Construct a small tensor (batch_size=2, feature_dim=4)
x = torch.randn(2, 4)

# Define arguments for drop_path function
ARGS = {
    "x": x,
    "drop_prob": 0.5,
    "training": 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 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
expand_box Ran
ran, honoured the contract we drafted
geshang777/FOCUS/focus/modeling/clip_refiner/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from workforai/scan, is pointer only (licence: NOASSERTION) · get_code("2fc0075c2a14b806")
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 workforai/scan, 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.

get_reference_points Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
geshang777/FOCUS/focus/modeling/edge_enhancer/edge_enhancer.py
code served (permissive licence) · get_code("8073d48cbfc0f7ad")
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 (1, 16, 1, 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

torch.manual_seed(0)

# spatial_shapes: list of tuples containing (H, W) dimensions for each level
spatial_shapes = [(4, 3), (2, 2)]

# device: torch device to place tensors on
device = torch.device('cpu')

ARGS = {
    'spatial_shapes': spatial_shapes,
    'device': device,
}
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 (1, 16, 1, 2) — shape (1, 16, 1, 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
make_optimizer Ran
ran on a synthesized input
geshang777/FOCUS/focus/evaluation/utils.py
code served (permissive licence) · get_code("6f80ac05b5e36f8e")
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 SGD. 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 torch.optim import SGD, Adam, AdamW

torch.manual_seed(0)

# Create a small model to get parameters
model = nn.Linear(4, 3)

# Define param_list - this is what the optimizer needs to optimize
param_list = model.parameters()

# Define optimizer_spec for SGD case
optimizer_spec_sgd = {
    'name': 'sgd',
    'args': {
        'lr': 0.01,
        'momentum': 0.9
    },
    'sd': None
}

# Create a sample optimizer state dict to test load_sd=True case
sample_optimizer = SGD(param_list, lr=0.01, momentum=0.9)
sample_optimizer_state = sample_optimizer.state_dict()

optimizer_spec_with_sd = {
    'name': 'adam',
    'args': {
        'lr': 0.001,
        'betas': (0.9, 0.999)
    },
    'sd': sample_optimizer_state
}

ARGS = {
    'param_list': model.parameters(),
    'optimizer_spec': optimizer_spec_sgd,
    'load_sd': 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 SGD — a SGD output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SGD 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
mask2box Ran
ran, honoured the contract we drafted
geshang777/FOCUS/focus/modeling/clip_refiner/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from workforai/scan, is pointer only (licence: NOASSERTION) · get_code("50372092a6e364ac")
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 workforai/scan, 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.

parse_custom_format Ran
ran; our contract draft was wrong, not the code
geshang777/Seg-R1/demo/seg_r1_web_demo.py
code served (permissive licence) · get_code("90862d4542046d4e")
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 numpy as np
import re

def parse_custom_format(content: str):
    point_pattern = '<points>\\s*(\\[\\s*(?:\\[\\s*\\d+\\s*,\\s*\\d+\\s*\\]\\s*,?\\s*)+\\])\\s*</points>'
    label_pattern = '<labels>\\s*(\\[\\s*(?:\\d+\\s*,?\\s*)+\\])\\s*</labels>'
    bbox_pattern = '<bbox>\\s*(\\[\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*\\])\\s*</bbox>'
    point_match = re.search(point_pattern, content)
    label_match = re.search(label_pattern, content)
    bbox_matches = re.findall(bbox_pattern, content)
    try:
        points = np.array(eval(point_match.group(1))) if point_match else None
        labels = np.array(eval(label_match.group(1))) if label_match else None
        if points is not None and labels is not None:
            if not (len(points.shape) == 2 and points.shape[1] == 2 and (len(labels) == points.shape[0])):
                points, labels = (None, None)
        bboxes = []
        for bbox_str in bbox_matches:
            bbox = np.array(eval(bbox_str))
            if len(bbox.shape) == 1 and bbox.shape[0] == 4:
                bboxes.append(bbox)
        bboxes = np.stack(bboxes, axis=0) if bboxes else None
        return (points, labels, bboxes)
    except Exception as e:
        print('Error parsing content:', e)
        return (None, None, None)

# Valid content with points, labels, and bboxes
content = """
<points>
    [[10, 20], [30, 40]]
</points>
<labels>
    [1, 2]
</labels>
<bbox>
    [5, 10, 15, 25]
</bbox>
<bbox>
    [35, 45, 55, 65]
</bbox>
"""

ARGS = {
    "content": content
}
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 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
parse_custom_format Ran
ran; our contract draft was wrong, not the code
geshang777/Seg-R1/eval/eval_referring_segmentation.py
code served (permissive licence) · get_code("1d256130c02aa3e9")
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 re
import numpy as np

# Construct a valid content string with points, labels, and bboxes
content = """
Some text before
<points>
[[10, 20], [30, 40], [50, 60]]
</points>
<labels>
[1, 2, 3]
</labels>
<bbox>
[0, 0, 100, 100]
</bbox>
<bbox>
[10, 10, 50, 50]
</bbox>
More text after
"""

ARGS = {
    "content": content
}
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 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
prepare_message Ran
ran; our contract draft was wrong, not the code
geshang777/Seg-R1/eval/eval_referring_segmentation.py
code served (permissive licence) · get_code("be1289f57ae4d5ad")
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 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 io
import base64
from PIL import Image
import tempfile
import os

# Create a small test image
def create_test_image():
    """Create a simple test image and save it to a temporary file"""
    img = Image.new('RGB', (256, 256), color='red')
    temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.jpg')
    img.save(temp_file, format='JPEG')
    temp_file.close()
    return temp_file.name

# Create test image path
test_image_path = create_test_image()

# Define ARGS
ARGS = {
    'img_path': test_image_path,
    'expr': ['object']
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, 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
prepare_test_messages Ran
ran; our contract draft was wrong, not the code
geshang777/Seg-R1/eval/eval_foreground_segmentation.py
code served (permissive licence) · get_code("01df73ec0b6daf48")
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 pandas as pd
import base64
import io
from PIL import Image
import tempfile
import os

# Create a temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create a small test image file
test_image_path = os.path.join(temp_dir, "test_image.jpg")
img = Image.new('RGB', (100, 100), color='red')
img.save(test_image_path, format='JPEG')

# Create a temporary JSONL testset file
testset_path = os.path.join(temp_dir, "testset.jsonl")
testset_data = [
    {"image_path": test_image_path, "id": 1},
    {"image_path": test_image_path, "id": 2}
]
with open(testset_path, 'w') as f:
    for record in testset_data:
        f.write(pd.Series(record).to_json() + '\n')

ARGS = {
    "testset_path": testset_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, pandas — 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
resize_image_to_base64 Ran
ran; our contract draft was wrong, not the code
geshang777/Seg-R1/eval/eval_foreground_segmentation.py
code served (permissive licence) · get_code("f5272a5a345c7d45")
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 str. 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 base64
import io
import tempfile
import os
from PIL import Image
import numpy as np

# Create a temporary image file to use as input
temp_dir = tempfile.mkdtemp()
temp_image_path = os.path.join(temp_dir, "test_image.jpg")

# Create a simple test image using PIL
test_image = Image.new('RGB', (100, 100), color='red')
test_image.save(temp_image_path, format='JPEG')

ARGS = {
    'image_path': temp_image_path,
    'size': (768, 768)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
resize_to_base64 Ran
ran; our contract draft was wrong, not the code
geshang777/Seg-R1/eval/eval_referring_segmentation.py
code served (permissive licence) · get_code("038e4fd33f4e3c0e")
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 str. 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 io
import base64
from PIL import Image
import tempfile
import os

# Create a temporary image file for testing
temp_dir = tempfile.gettempdir()
temp_image_path = os.path.join(temp_dir, "test_image.jpg")

# Create a simple test image and save it
test_img = Image.new('RGB', (512, 512), color='red')
test_img.save(temp_image_path, format='JPEG')

ARGS = {
    'path': temp_image_path,
    'size': (1024, 1024)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
sigmoid_ce_loss Ran
ran; our contract draft was wrong, not the code
geshang777/FOCUS/focus/modeling/criterion.py
code served (permissive licence) · get_code("d0c61e8dba511aa3")
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 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.functional as F

torch.manual_seed(0)

# Create small tensors for inputs and targets
# inputs: predictions (logits), arbitrary shape
# targets: binary labels (0 or 1), same shape as inputs
batch_size = 2
num_elements = 4

inputs = torch.randn(batch_size, num_elements, dtype=torch.float32)
targets = torch.randint(0, 2, (batch_size, num_elements), dtype=torch.float32)

# num_masks: used as divisor in the loss computation
num_masks = 2.0

ARGS = {
    "inputs": inputs,
    "targets": targets,
    "num_masks": num_masks,
}
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 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
time_text Ran
ran; our contract draft was wrong, not the code
geshang777/FOCUS/focus/evaluation/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from ai-spatial/GeoSR-Bench, is pointer only (licence: NONE) · get_code("14982a5b13861f94")
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 ai-spatial/GeoSR-Bench, 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.

window_partition Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
geshang777/FOCUS/focus/modeling/backbone/dinov2.py
code served (permissive licence) · get_code("f9fd6241d935f07b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 4, dtype family float, shape (12, 4, 4, 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)

# Create a tensor with shape (B, H, W, C)
# B = 2 (batch size)
# H = 8 (height, must be divisible by window_size)
# W = 12 (width, must be divisible by window_size)
# C = 4 (channels)
# window_size = 4

B = 2
H = 8
W = 12
C = 4
window_size = 4

x = torch.randn(B, H, W, C)

ARGS = {
    'x': x,
    'window_size': window_size
}
Setup block drafted by
a language model, Claude Sonnet 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 4, dtype family float, shape (12, 4, 4, 4) — shape (12, 4, 4, 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
window_reverse Ran
ran; our contract draft was wrong, not the code
geshang777/FOCUS/focus/modeling/backbone/dinov2.py
code served (permissive licence) · get_code("fb32094c6dbece71")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 4, dtype family float, shape (2, 8, 12, 6) 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)

# Define parameters
# We need windows of shape (num_windows*B, window_size, window_size, C)
# where num_windows = (H // window_size) * (W // window_size)

B = 2
H = 8
W = 12
window_size = 4
C = 6

# Calculate num_windows
num_windows_h = H // window_size  # 8 // 4 = 2
num_windows_w = W // window_size  # 12 // 4 = 3
num_windows = num_windows_h * num_windows_w  # 2 * 3 = 6

# Total number of windows across batch
total_windows = num_windows * B  # 6 * 2 = 12

# Create windows tensor
windows = torch.randn(total_windows, window_size, window_size, C)

ARGS = {
    'windows': windows,
    'window_size': window_size,
    'H': H,
    'W': W
}
Setup block drafted by
a language model, Claude Sonnet 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 4, dtype family float, shape (2, 8, 12, 6) — shape (2, 8, 12, 6) 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
batch_sigmoid_ce_loss Not yet run
unverified (harvested, no recorded run)
geshang777/FOCUS/focus/modeling/matcher.py
code served (permissive licence) · get_code("1edd24985036b0bf")
How it ran

no invocation recorded.

Also present in other papers' code

Of 23 samples lifted from this paper's linked repositories, 23 carry a function identity and 0 do not. Of the 22 distinct functions with an identity, 15 are also present in other papers whose code we hold (15 with at least one paper dated earlier, 7 the same month, 8 later) and 7 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
window_reverse 227 other papers
214 dated earlier, 2 the same month, 8 later, 3 same year, order not determinable · 34 only as an assembly brick
1608.03983 (2016-08)
SGDR: Stochastic Gradient Descent with Warm Restarts
1711.10925 (2017-11)
Deep Image Prior
2003.13678 (2020-03)
Designing Network Design Spaces
and 224 more not named here
window_partition 223 other papers
209 dated earlier, 2 the same month, 8 later, 4 same year, order not determinable · 32 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1711.10925 (2017-11)
Deep Image Prior
2003.13678 (2020-03)
Designing Network Design Spaces
and 220 more not named here
dice_loss 46 other papers
42 dated earlier, 1 the same month, 3 later
2112.01527 (2021-12)
Masked-attention Mask Transformer for Universal Image Segmentation
2112.10764 (2021-12)
Mask2Former for Video Instance Segmentation
2203.03605 (2022-03)
DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection
and 43 more not named here
sigmoid_ce_loss 45 other papers
41 dated earlier, 1 the same month, 3 later
2112.01527 (2021-12)
Masked-attention Mask Transformer for Universal Image Segmentation
2112.10764 (2021-12)
Mask2Former for Video Instance Segmentation
2203.03605 (2022-03)
DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection
and 42 more not named here
batch_dice_loss 44 other papers
40 dated earlier, 1 the same month, 3 later
2112.01527 (2021-12)
Masked-attention Mask Transformer for Universal Image Segmentation
2112.10764 (2021-12)
Mask2Former for Video Instance Segmentation
2203.03605 (2022-03)
DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection
and 41 more not named here
batch_sigmoid_ce_loss 44 other papers
40 dated earlier, 1 the same month, 3 later
2112.01527 (2021-12)
Masked-attention Mask Transformer for Universal Image Segmentation
2112.10764 (2021-12)
Mask2Former for Video Instance Segmentation
2203.03605 (2022-03)
DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection
and 41 more not named here
calculate_uncertainty 34 other papers
33 dated earlier, 1 later
2112.01527 (2021-12)
Masked-attention Mask Transformer for Universal Image Segmentation
2112.10764 (2021-12)
Mask2Former for Video Instance Segmentation
2203.04187 (2022-03)
RankSeg: Adaptive Pixel Classification with Image Category Ranking for Segmentation
and 31 more not named here
time_text 8 other papers
6 dated earlier, 1 the same month, 1 later
2108.11084 (2021-08)
Transformer for Single Image Super-Resolution
2111.08918 (2021-11)
Local Texture Estimator for Implicit Representation Function
and 5 more not named here
cross_entropy 6 other papers
6 dated earlier
2103.00020 (2021-03)
Learning Transferable Visual Models From Natural Language Supervision
2203.03897 (2022-03)
Geodesic Multi-Modal Mixup for Robust Fine-Tuning
2306.01859 (2023-06)
Spatially Resolved Gene Expression Prediction from H&amp;E Histology Images via Bi-modal Contrastive Learning
and 3 more not named here
compute_num_params 4 other papers
4 dated earlier
2111.08918 (2021-11)
Local Texture Estimator for Implicit Representation Function
Pak_B-Spline_Texture_Coefficients_Estimator_for_Screen_Content_Image_Super-Resolution_CVPR_2023_paper (2023 (year only))
B-spline Texture Coefficients Estimator for Screen Content Image Super-Resolution
and 1 more not named here
get_reference_points 2 other papers
2 dated earlier
2403.07392 (2024-03)
ViT-CoMer: Vision Transformer with Convolutional Multi-scale Feature Interaction for Dense Predictions
2403.11193 (2024-03)
Neural Markov Random Field for Stereo Matching
crop_with_mask 1 other paper
1 dated earlier
2312.04089 (2023-12)
Open-Vocabulary Segmentation with Semantic-Assisted Calibration
drop_path 1 other paper
1 dated earlier
2503.08685 (2025-03)
"Principal Components" Enable A New Language of Images
expand_box 1 other paper
1 dated earlier
2312.04089 (2023-12)
Open-Vocabulary Segmentation with Semantic-Assisted Calibration
mask2box 1 other paper
1 dated earlier
2312.04089 (2023-12)
Open-Vocabulary Segmentation with Semantic-Assisted Calibration

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

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 Seg-R1, a preliminary exploration of using reinforcement learning (RL) to enhance the pixel-level understanding and reasoning capabilities of large multimodal models (LMMs). Starting with foreground segmentation tasks, specifically camouflaged object detection (COD) and salient object detection (SOD), our approach enables the LMM to generate point and bounding box prompts in the next-token fashion, which are then used to guide SAM2 in producing segmentation masks. We introduce Group Relative Policy Optimization (GRPO) into the segmentation domain, equipping the LMM with pixel-level comprehension through a carefully designed training strategy. Notably, Seg-R1 achieves remarkable performance with purely RL-based training, achieving .873 S-measure on COD10K without complex model modification. Moreover, we found that pure RL training demonstrates strong open-world generalization. Despite being trained solely on foreground segmentation image-mask pairs without text supervision, Seg-R1 achieves impressive zero-shot performance on referring segmentation and reasoning segmentation tasks, with 71.4 cIoU on RefCOCOg test and 56.7 gIoU on ReasonSeg test, outperforming models fully supervised on these datasets.

For agents

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

get_harvested_code_for_paper("2506.22624")
get_code_for_paper("2506.22624")
have("2506.22624")

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

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

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

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

Connect an agent — have() is free.