SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.09085 · 2024

Segment Anything with Multiple Modalities

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 3 no recorded run), measured 2026-11-22; 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/2408.09085.json · badge: /api/ran/2408.09085.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
weihao1115/mm-sam canonical (classifier label)
classifier basis: census
6 ran · 3 no recorded run
FunctionStatusWhere it lives
find_bound_box_on_objects Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
weihao1115/mm-sam/mm_sam/datasets/gen_prompts.py
code served (permissive licence) · get_code("4ccb5960528c349c")
How it ran

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

# Create sample object regions as a list of coordinate arrays
# Each array represents the coordinates of pixels in a mask
# Format: each row is [y, x] coordinate

# First object region with some coordinates
object_region_1 = np.array([
    [10, 20],
    [10, 25],
    [15, 20],
    [15, 25]
], dtype=np.int32)

# Second object region with different coordinates
object_region_2 = np.array([
    [30, 40],
    [30, 50],
    [40, 40],
    [40, 50]
], dtype=np.int32)

object_regions = [object_region_1, object_region_2]

ARGS = {
    "object_regions": object_regions
}
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, ndim 2, dtype family int — 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
find_objects_from_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
weihao1115/mm-sam/mm_sam/datasets/gen_prompts.py
code served (permissive licence) · get_code("1c107a124798ad43")
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 cv2
import numpy as np

# Create a simple binary mask with some connected components
# The mask should have some objects (non-zero regions) for the function to detect
mask = np.zeros((50, 50), dtype=np.uint8)

# Add a few distinct objects (connected components)
# Object 1: a larger blob
mask[10:20, 10:20] = 1

# Object 2: a medium blob
mask[25:32, 25:32] = 1

# Object 3: a small blob
mask[5:8, 40:43] = 1

ARGS = {
    "mask": mask,
    "relative_threshold": True,
    "area_threshold": 20,
    "relative_threshold_ratio": 0.001,
    "connectivity": 8,
}
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 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
find_random_points_in_objects Ran
ran; our contract draft was wrong, not the code
weihao1115/mm-sam/mm_sam/datasets/gen_prompts.py
code served (permissive licence) · get_code("d0935f8f9c98d934")
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
import random

# Set seed for reproducibility
random.seed(0)
np.random.seed(0)

# Create sample object regions
# object_regions is a List[np.ndarray] where each ndarray contains coordinates
# The function expects each element to have shape (N, 2) where N is number of points
# and each point is [y, x] based on how it's accessed: object_indices[idx][1], object_indices[idx][0]

object_regions = [
    np.array([[10, 20], [15, 25], [12, 22], [18, 30], [14, 24]]),  # 5 points
    np.array([[5, 10], [8, 12], [7, 11]]),  # 3 points
    np.array([[100, 150], [105, 155], [102, 152], [110, 160], [108, 158], [103, 153]])  # 6 points
]

ARGS = {
    "object_regions": object_regions,
    "prompt_point_num": 3,
    "random_num_prompt": True
}
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_idx2data_dict Ran
ran; our contract draft was wrong, not the code
weihao1115/mm-sam/mm_sam/datasets/sunrgbd.py
code served (permissive licence) · get_code("3cf9f76265ba0524")
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 os
import tempfile

# Create a temporary directory structure with the required text files
temp_dir = tempfile.mkdtemp()

# Create training depth file
train_depth_content = """scene_01/frame_001/depth.png
scene_02/frame_002/depth.png
scene_03/frame_003/depth.png
"""
with open(os.path.join(temp_dir, 'train_depth.txt'), 'w') as f:
    f.write(train_depth_content)

# Create training RGB file
train_rgb_content = """scene_01/frame_001/rgb.png
scene_02/frame_002/rgb.png
scene_03/frame_003/rgb.png
"""
with open(os.path.join(temp_dir, 'train_rgb.txt'), 'w') as f:
    f.write(train_rgb_content)

# Create training label file
train_label_content = """scene_01/frame_001/label.png
scene_02/frame_002/label.png
scene_03/frame_003/label.png
"""
with open(os.path.join(temp_dir, 'train_label.txt'), 'w') as f:
    f.write(train_label_content)

# Create testing depth file
test_depth_content = """scene_04/frame_004/depth.png
scene_05/frame_005/depth.png
"""
with open(os.path.join(temp_dir, 'test_depth.txt'), 'w') as f:
    f.write(test_depth_content)

# Create testing RGB file
test_rgb_content = """scene_04/frame_004/rgb.png
scene_05/frame_005/rgb.png
"""
with open(os.path.join(temp_dir, 'test_rgb.txt'), 'w') as f:
    f.write(test_rgb_content)

# Create testing label file
test_label_content = """scene_04/frame_004/label.png
scene_05/frame_005/label.png
"""
with open(os.path.join(temp_dir, 'test_label.txt'), 'w') as f:
    f.write(test_label_content)

ARGS = {
    'data_dir': temp_dir,
    'train_flag': True
}
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 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_prompts_by_sem_inst_masks Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
weihao1115/mm-sam/mm_sam/datasets/pc_utils.py
code served (permissive licence) · get_code("25d23c641c2c13e8")
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 small semantic and instance masks
# sem_mask: semantic segmentation mask with class labels
# inst_mask: instance segmentation mask with instance IDs
mask_height, mask_width = 10, 12
sem_mask = np.array([
    [0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0],
    [0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0],
    [0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0],
    [3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0],
    [3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4],
    [0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
], dtype=np.int64)

inst_mask = np.array([
    [0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0],
    [0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0],
    [0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0],
    [3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0],
    [3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4],
    [0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
], dtype=np.int64)

ARGS = {
    "sem_mask": sem_mask,
    "inst_mask": inst_mask,
    "tgt_prompts": ["point", "box"],
    "area_threshold": 4,
    "prompt_point_num": 1,
    "foreground_only": True,
    "ignore_idx": 255,
    "background_idx": 0,
}
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
proj_3d_scan_to_2d_img Ran
ran; our contract draft was wrong, not the code
weihao1115/mm-sam/mm_sam/datasets/pc_utils.py
code served (permissive licence) · get_code("b5e590566082e6ac")
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
from typing import Tuple

# Set seed for reproducibility
np.random.seed(0)

# Create small test data
num_points = 10
img_height = 32
img_width = 48
scan_channels = 4

# proj_yx: projection coordinates (y, x) for each 3D point
proj_yx = np.array([
    [5, 10],
    [8, 15],
    [12, 20],
    [15, 25],
    [18, 30],
    [20, 35],
    [25, 40],
    [28, 45],
    [10, 12],
    [14, 18],
], dtype=np.int32)

# scan_data: feature data for each 3D point (num_points x channels)
scan_data = np.random.randn(num_points, scan_channels).astype(np.float32)

# img_size: (height, width)
img_size = (img_height, img_width)

# sem_labels: semantic labels for each point
sem_labels = np.array([1, 2, 1, 3, 2, 1, 0, 2, 1, 3], dtype=np.uint8)

# inst_labels: instance labels for each point
inst_labels = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], dtype=np.uint8)

# Other parameters
foreground_only = True
ignore_idx = 255
background_idx = 0
placeholder_idx = 0

ARGS = {
    'proj_yx': proj_yx,
    'scan_data': scan_data,
    'img_size': img_size,
    'sem_labels': sem_labels,
    'inst_labels': inst_labels,
    'foreground_only': foreground_only,
    'ignore_idx': ignore_idx,
    'background_idx': background_idx,
    'placeholder_idx': placeholder_idx,
}
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
build_sam_vit_b Not yet run
unverified (harvested, no recorded run)
weihao1115/mm-sam/segment_anything/build_sam.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from yatengLG/ISAT_with_segment_anything, is pointer only (licence: NOASSERTION) · get_code("f9bc5f31ce61cee8")
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 yatengLG/ISAT_with_segment_anything, 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. No invocation recorded.

build_sam_vit_h Not yet run
unverified (harvested, no recorded run)
weihao1115/mm-sam/segment_anything/build_sam.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from yatengLG/ISAT_with_segment_anything, is pointer only (licence: NOASSERTION) · get_code("6b77c1f11fff3ed6")
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 yatengLG/ISAT_with_segment_anything, 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. No invocation recorded.

build_sam_vit_l Not yet run
unverified (harvested, no recorded run)
weihao1115/mm-sam/segment_anything/build_sam.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from yatengLG/ISAT_with_segment_anything, is pointer only (licence: NOASSERTION) · get_code("3f8890e695469246")
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 yatengLG/ISAT_with_segment_anything, 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. No invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 3 later) and 5 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
build_sam_vit_h 37 other papers
27 dated earlier, 8 later, 2 same year, order not determinable · 2 only as an assembly brick
2304.06790 (2023-04)
Inpaint Anything: Segment Anything Meets Image Inpainting
2304.12306 (2023-04)
Segment Anything in Medical Images
2305.01586 (2023-05)
An Alternative to WSSS? An Empirical Study of the Segment Anything Model (SAM) on Weakly-Supervised Semantic Segmentation Problems
and 34 more not named here
build_sam_vit_b 34 other papers
26 dated earlier, 6 later, 2 same year, order not determinable
2304.06790 (2023-04)
Inpaint Anything: Segment Anything Meets Image Inpainting
2304.12306 (2023-04)
Segment Anything in Medical Images
2305.01586 (2023-05)
An Alternative to WSSS? An Empirical Study of the Segment Anything Model (SAM) on Weakly-Supervised Semantic Segmentation Problems
and 31 more not named here
build_sam_vit_l 34 other papers
26 dated earlier, 6 later, 2 same year, order not determinable
2304.06790 (2023-04)
Inpaint Anything: Segment Anything Meets Image Inpainting
2304.12306 (2023-04)
Segment Anything in Medical Images
2305.01586 (2023-05)
An Alternative to WSSS? An Empirical Study of the Segment Anything Model (SAM) on Weakly-Supervised Semantic Segmentation Problems
and 31 more not named here
find_random_points_in_objects 1 other paper
1 dated earlier
2402.03631 (2024-02)
CAT-SAM: Conditional Tuning for Few-Shot Adaptation of Segment Anything Model

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

Repositories linked to this paper

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

Abstract

Robust and accurate segmentation of scenes has become one core functionality in various visual recognition and navigation tasks. This has inspired the recent development of Segment Anything Model (SAM), a foundation model for general mask segmentation. However, SAM is largely tailored for single-modal RGB images, limiting its applicability to multi-modal data captured with widely-adopted sensor suites, such as LiDAR plus RGB, depth plus RGB, thermal plus RGB, etc. We develop MM-SAM, an extension and expansion of SAM that supports cross-modal and multi-modal processing for robust and enhanced segmentation with different sensor suites. MM-SAM features two key designs, namely, unsupervised cross-modal transfer and weakly-supervised multi-modal fusion, enabling label-efficient and parameter-efficient adaptation toward various sensor modalities. It addresses three main challenges: 1) adaptation toward diverse non-RGB sensors for single-modal processing, 2) synergistic processing of multi-modal data via sensor fusion, and 3) mask-free training for different downstream tasks. Extensive experiments show that MM-SAM consistently outperforms SAM by large margins, demonstrating its effectiveness and robustness across various sensors and data modalities.

For agents

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

get_harvested_code_for_paper("2408.09085")
get_code_for_paper("2408.09085")
have("2408.09085")

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

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

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

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

Connect an agent — have() is free.