SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.16051 · 2024

Segment Anything Model for Road Network Graph Extraction

arXiv · PDF · Open in the Atlas

Code that ran

17 of 18 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 15 failures of our instrument; 1 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/2403.16051.json · badge: /api/ran/2403.16051.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
htcr/sam_road canonical (classifier label)
classifier basis: census
17 ran · 1 no recorded run
FunctionStatusWhere it lives
create_output_dir_and_save_config Ran
ran; our contract draft was wrong, not the code
htcr/sam_road/utils.py
code served (permissive licence) · get_code("eace594ace06c68f")
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 torch
import numpy as np
import os
import tempfile
from datetime import datetime

# Create a small stand-in config class that has a to_dict() method
class Config:
    def __init__(self):
        self.model_name = "test_model"
        self.learning_rate = 0.001
        self.batch_size = 32
        self.epochs = 10
    
    def to_dict(self):
        return {
            'model_name': self.model_name,
            'learning_rate': self.learning_rate,
            'batch_size': self.batch_size,
            'epochs': self.epochs
        }

# Create temporary directory for output
temp_dir = tempfile.mkdtemp()
output_dir_prefix = os.path.join(temp_dir, 'experiment_output')

# Create config instance
config = Config()

# Create the ARGS dictionary
ARGS = {
    'output_dir_prefix': output_dir_prefix,
    'config': config,
    'specified_dir': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, yaml — 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
crop_img_patch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
htcr/sam_road/inferencer.py
code served (permissive licence) · get_code("9847c4aa680f7f58")
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 ndarray, ndim 3, dtype family int, shape (4, 3, 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
import numpy as np

torch.manual_seed(0)

# Create a small image tensor with shape (height, width, channels)
# Using distinct dimensions: 8 height, 6 width, 3 channels (RGB)
img = torch.randint(0, 256, (8, 6, 3), dtype=torch.uint8).numpy()

# Define crop coordinates
x0 = 1
y0 = 2
x1 = 4
y1 = 6

ARGS = {
    "img": img,
    "x0": x0,
    "y0": y0,
    "x1": x1,
    "y1": y1
}
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 ndarray, ndim 3, dtype family int, shape (4, 3, 3) — shape (4, 3, 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
draw_line_segments_on_image Ran
ran; our contract draft was wrong, not the code
htcr/sam_road/spacenet/generate_labels.py
code served (permissive licence) · get_code("62990ee83bc6c9e9")
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 ndarray, ndim 2, dtype family int, shape (100, 100) 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 numpy as np
import cv2

ARGS = {
    "size": 100,
    "line_segments": [
        ((10, 20), (50, 60)),
        ((30, 40), (80, 90)),
        ((5, 5), (95, 95))
    ],
    "width": 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (100, 100) — shape (100, 100) 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
draw_points_on_image Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
htcr/sam_road/graph_extraction.py
code served (permissive licence) · get_code("2f135d04199d9188")
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 ndarray, ndim 3, dtype family int, shape (100, 100, 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 cv2
import numpy as np

# Create a simple square image (100x100 pixels, 3 channels for BGR)
image = np.ones((100, 100, 3), dtype=np.uint8) * 255

# Create a list of points as (x, y) tuples in pixel coordinates
points = [(25, 25), (50, 50), (75, 75), (30, 70)]

# Radius for the circles
radius = 5

ARGS = {
    "image": image,
    "points": points,
    "radius": radius
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (100, 100, 3) — shape (100, 100, 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
draw_points_on_image Ran
ran; our contract draft was wrong, not the code
htcr/sam_road/spacenet/generate_labels.py
code served (permissive licence) · get_code("998429d0ff5eb4a1")
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 ndarray, ndim 2, dtype family int, shape (100, 100) 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 numpy as np
import cv2

# Construct arguments for draw_points_on_image

size = 100  # Square image of 100x100 pixels

points = [
    (25, 25),   # First point at (25, 25)
    (50, 50),   # Second point at (50, 50)
    (75, 75),   # Third point at (75, 75)
]

radius = 5  # Radius of circles in pixels

ARGS = {
    "size": size,
    "points": points,
    "radius": radius,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (100, 100) — shape (100, 100) 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
edge_list_to_adj_table Ran
ran; our contract draft was wrong, not the code
htcr/sam_road/graph_utils.py
code served (permissive licence) · get_code("43d91f90853adbd0")
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 torch

torch.manual_seed(0)

# The function takes edges as input
# It expects edges to be an iterable of edge objects where each edge has indices accessible as edge[0] and edge[1]
# The function builds an adjacency table (list of sets) from the edge list

edges = [
    (0, 1),
    (0, 2),
    (1, 2),
    (2, 3),
]

ARGS = {
    "edges": edges
}
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 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
edge_list_to_adj_table Ran
ran; our contract draft was wrong, not the code
htcr/sam_road/graph_utils.py
code served (permissive licence) · get_code("0bf072401f5943d4")
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 torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - nodes: used only for len(nodes), so can be a list or any sequence
# - edges: iterated over, each element indexed as edge[0] and edge[1]
#          so needs to be a list of tuples/lists with at least 2 elements

# Build small test data
nodes = [0, 1, 2, 3]  # 4 nodes
edges = [
    (0, 1),
    (0, 2),
    (1, 3),
    (2, 3),
]

ARGS = {
    "nodes": nodes,
    "edges": edges,
}
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 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
filter_nodes Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
htcr/sam_road/graph_utils.py
code served (permissive licence) · get_code("68ccab6be670bfc4")
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

# Create node array: shape (5, 3) - 5 nodes with 3 features each
node_array = np.array([
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0],
    [7.0, 8.0, 9.0],
    [10.0, 11.0, 12.0],
    [13.0, 14.0, 15.0]
], dtype=np.float32)

# Create edge array: shape (4, 2) - 4 edges, each edge connects 2 nodes
edge_array = np.array([
    [0, 1],
    [1, 2],
    [2, 3],
    [3, 4]
], dtype=np.int32)

# Create keep_node boolean array: keep nodes 0, 2, 3 (filter out 1 and 4)
keep_node = np.array([True, False, True, True, False], dtype=bool)

ARGS = {
    "node_array": node_array,
    "edge_array": edge_array,
    "keep_node": keep_node
}
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
get_img_paths Ran
ran; our contract draft was wrong, not the code
htcr/sam_road/inferencer.py
code served (permissive licence) · get_code("53810f783e40cd12")
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 os
import tempfile

# Create a temporary directory to serve as root_dir
temp_dir = tempfile.mkdtemp()

# Define the arguments
ARGS = {
    'root_dir': temp_dir,
    'image_indices': [0, 1, 2, 5]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
get_patch_info_one_img Ran
ran; our contract draft was wrong, not the code
htcr/sam_road/dataset.py
code served (permissive licence) · get_code("e65200eaf5162974")
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. 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

ARGS = {
    "image_index": 0,
    "image_size": 256,
    "sample_margin": 10,
    "patch_size": 32,
    "patches_per_edge": 4
}
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 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_points_and_scores_from_mask Ran
ran; our contract draft was wrong, not the code
htcr/sam_road/graph_extraction.py
code served (permissive licence) · get_code("dff7a9d2d4290664")
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

# Create a small 2D mask array with values between 0 and 1
# Shape: 4x3 (height x width) with some values above and below threshold
mask = np.array([
    [0.1, 0.6, 0.2],
    [0.7, 0.3, 0.8],
    [0.4, 0.9, 0.5],
    [0.2, 0.1, 0.75]
], dtype=np.float32)

threshold = 0.5

ARGS = {
    "mask": mask,
    "threshold": threshold
}
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
graph_collate_fn Ran
ran; our contract draft was wrong, not the code
htcr/sam_road/dataset.py
code served (permissive licence) · get_code("49fc6bdb42872104")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function expects a batch which is a list of dicts
# Each dict should have:
# - 'graph_points': a tensor of shape (num_points, 2)
# - other keys with tensors that can be stacked

batch = [
    {
        'graph_points': torch.randn(3, 2),
        'label': torch.tensor([1.0]),
        'id': torch.tensor([0])
    },
    {
        'graph_points': torch.randn(5, 2),
        'label': torch.tensor([2.0]),
        'id': torch.tensor([1])
    }
]

ARGS = {
    'batch': batch
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rasterize_graph Ran
ran; our contract draft was wrong, not the code
htcr/sam_road/triage.py
code served (permissive licence) · get_code("c4b20ca211d254a0")
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 ndarray, ndim 3, dtype family int, shape (256, 256, 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 cv2
import numpy as np

# Create small test data
nodes = np.array([
    [0.2, 0.3],
    [0.5, 0.6],
    [0.8, 0.9]
], dtype=np.float32)

edges = np.array([
    [0, 1],
    [1, 2]
], dtype=np.int32)

viz_img_size = 256

dilation_radius = 5

ARGS = {
    "nodes": nodes,
    "edges": edges,
    "viz_img_size": viz_img_size,
    "dilation_radius": dilation_radius
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (256, 256, 3) — shape (256, 256, 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
read_rgb_img Ran
ran, honoured the contract we drafted
htcr/sam_road/dataset.py
code served (permissive licence) · get_code("787e3dce7cf3f6a1")
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 ndarray, ndim 3, dtype family int, shape (4, 3, 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 cv2
import numpy as np
import tempfile
import os

# Create a temporary image file
temp_dir = tempfile.mkdtemp()
temp_path = os.path.join(temp_dir, "test_image.png")

# Create a simple RGB image and save it as BGR (since cv2.imread reads as BGR)
# Create a small 4x3 image with some color variation
img_array = np.zeros((4, 3, 3), dtype=np.uint8)
img_array[0, 0] = [255, 0, 0]  # Red in RGB, will be BGR
img_array[1, 1] = [0, 255, 0]  # Green
img_array[2, 2] = [0, 0, 255]  # Blue
img_array[3, 0] = [255, 255, 0]  # Yellow

# Convert RGB to BGR for saving
bgr_array = cv2.cvtColor(img_array, cv2.COLOR_RGB2BGR)
cv2.imwrite(temp_path, bgr_array)

ARGS = {
    "path": temp_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (4, 3, 3) — shape (4, 3, 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
visualize_image_and_graph Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
htcr/sam_road/triage.py
code served (permissive licence) · get_code("acad5f61c59c85f5")
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 ndarray, ndim 3, dtype family int, shape (512, 512, 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 cv2
import numpy as np

# Create a small RGB image (512x512x3)
img = np.random.randint(0, 256, (512, 512, 3), dtype=np.uint8)

# Create nodes as normalized coordinates (num_nodes x 2)
# Each node has [x, y] normalized to [0, 1]
nodes = np.array([
    [0.2, 0.3],
    [0.5, 0.5],
    [0.8, 0.7],
    [0.1, 0.9]
], dtype=np.float32)

# Create edges as pairs of node indices
edges = np.array([
    [0, 1],
    [1, 2],
    [2, 3],
    [0, 3]
], dtype=np.int32)

ARGS = {
    "img": img,
    "nodes": nodes,
    "edges": edges,
    "viz_img_size": 512
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (512, 512, 3) — shape (512, 512, 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
visualize_pred_gt_pair Ran
ran, honoured the contract we drafted
htcr/sam_road/triage.py
code served (permissive licence) · get_code("b7d7f725d4dc325c")
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 ndarray, ndim 3, dtype family int, shape (512, 1024, 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 cv2
import numpy as np
import tempfile
import os

# Create a temporary image file for testing
# Create a small RGB image (100x100x3)
temp_img = np.random.randint(0, 255, (100, 100, 3), dtype=np.uint8)
temp_img_rgb = cv2.cvtColor(temp_img, cv2.COLOR_BGR2RGB)

# Create a temporary file to save the image
with tempfile.NamedTemporaryFile(suffix='.png', delete=False) as f:
    temp_img_path = f.name
    cv2.imwrite(temp_img_path, temp_img)

# Create sample nodes (normalized coordinates between 0 and 1)
# Shape: (num_nodes, 2) - coordinates in (y, x) format after reversal
pred_nodes = np.array([
    [0.2, 0.3],
    [0.5, 0.5],
    [0.8, 0.7],
    [0.1, 0.9]
], dtype=np.float32)

gt_nodes = np.array([
    [0.25, 0.35],
    [0.55, 0.45],
    [0.75, 0.65],
    [0.15, 0.85]
], dtype=np.float32)

# Create sample edges (pairs of node indices)
pred_edges = np.array([
    [0, 1],
    [1, 2],
    [2, 3]
], dtype=np.int32)

gt_edges = np.array([
    [0, 1],
    [1, 2],
    [2, 3]
], dtype=np.int32)

# Construct the result dictionary
result = {
    'img_path': temp_img_path,
    'pred_nodes': pred_nodes,
    'pred_edges': pred_edges,
    'gt_nodes': gt_nodes,
    'gt_edges': gt_edges
}

ARGS = {
    'result': result
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (512, 1024, 3) — shape (512, 1024, 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
within_margin Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
htcr/sam_road/spacenet_metrics/spacenet_convert.py
code served (permissive licence) · get_code("0b3109c04bded2ae")
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 bool, 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 numpy as np

torch.manual_seed(0)

# The function takes a parameter 'v' and checks if v[0] and v[1] are within certain bounds
# v needs to be indexable with [0] and [1], so it can be a list, tuple, or array

# Create a valid argument that satisfies the condition (within margin)
v_within = [100, 100]  # v[0]=100 > 24 and < 376, v[1]=100 > 24 and < 376

ARGS = {
    "v": v_within
}
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 bool, 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
get_batch_img_patches Not yet run
unverified (harvested, no recorded run)
htcr/sam_road/inferencer.py
code served (permissive licence) · get_code("9666fa4a61dfac77")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 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 18 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-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 propose SAM-Road, an adaptation of the Segment Anything Model (SAM) for extracting large-scale, vectorized road network graphs from satellite imagery. To predict graph geometry, we formulate it as a dense semantic segmentation task, leveraging the inherent strengths of SAM. The image encoder of SAM is fine-tuned to produce probability masks for roads and intersections, from which the graph vertices are extracted via simple non-maximum suppression. To predict graph topology, we designed a lightweight transformer-based graph neural network, which leverages the SAM image embeddings to estimate the edge existence probabilities between vertices. Our approach directly predicts the graph vertices and edges for large regions without expensive and complex post-processing heuristics, and is capable of building complete road network graphs spanning multiple square kilometers in a matter of seconds. With its simple, straightforward, and minimalist design, SAM-Road achieves comparable accuracy with the state-of-the-art method RNGDet++, while being 40 times faster on the City-scale dataset. We thus demonstrate the power of a foundational vision model when applied to a graph learning task. The code is available at https://github.com/htcr/sam_road.

For agents

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

get_harvested_code_for_paper("2403.16051")
get_code_for_paper("2403.16051")
have("2403.16051")

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

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

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

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

Connect an agent — have() is free.