SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.16623 · 2023

The Segment Anything Model (SAM) for Remote Sensing Applications: From Zero to One Shot

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 0 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/2306.16623.json · badge: /api/ran/2306.16623.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
opengeos/segment-geospatial canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
FunctionStatusWhere it lives
get_icon_path Ran
ran on a synthesized input
opengeos/segment-geospatial/qgis-samgeo-plugin/resources.py
code served (permissive licence) · get_code("9272bb540b5a3d79")
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 os
import tempfile

# Create a temporary directory to act as PLUGIN_DIR
PLUGIN_DIR = tempfile.mkdtemp()

# Create the icons subdirectory
icons_dir = os.path.join(PLUGIN_DIR, 'icons')
os.makedirs(icons_dir, exist_ok=True)

# Create a dummy icon file
icon_path = os.path.join(icons_dir, 'icon.png')
with open(icon_path, 'w') as f:
    f.write('')

# Create another dummy icon for testing
custom_icon_path = os.path.join(icons_dir, 'custom.png')
with open(custom_icon_path, 'w') as f:
    f.write('')

# Patch the module-level PLUGIN_DIR in the function's namespace
import sys
import types

# Create a mock module for the function
mock_module = types.ModuleType('mock_plugin')
mock_module.PLUGIN_DIR = PLUGIN_DIR

def get_icon_path(icon_name='icon.png'):
    """Get the path to an icon file.

    Args:
        icon_name: Name of the icon file.

    Returns:
        str: Full path to the icon file.
    """
    return os.path.join(PLUGIN_DIR, 'icons', icon_name)

# Define arguments
ARGS = {
    'icon_name': 'icon.png'
}
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 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
get_venv_pip_path Ran
ran on a synthesized input
opengeos/segment-geospatial/qgis-samgeo-plugin/core/venv_manager.py
code served (permissive licence) · get_code("b30f662e6405e3c8")
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 os
import sys

PYTHON_VERSION = f'py{sys.version_info.major}.{sys.version_info.minor}'

CACHE_DIR = os.environ.get('SAMGEO_CACHE_DIR') or os.environ.get('SAMGEO_VENV_DIR') or os.path.expanduser('~/.qgis_samgeo')

VENV_DIR = os.path.join(CACHE_DIR, f'venv_{PYTHON_VERSION}')

def get_venv_pip_path(venv_dir: str=None) -> str:
    """Get the pip executable path within the venv.

    Args:
        venv_dir: Optional venv directory path. Uses VENV_DIR if None.

    Returns:
        Path to the venv pip executable.
    """
    if venv_dir is None:
        venv_dir = VENV_DIR
    if sys.platform == 'win32':
        return os.path.join(venv_dir, 'Scripts', 'pip.exe')
    else:
        return os.path.join(venv_dir, 'bin', 'pip')


ARGS = {
    'venv_dir': None
}
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 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
get_venv_python_path Ran
ran on a synthesized input
opengeos/segment-geospatial/qgis-samgeo-plugin/core/venv_manager.py
code served (permissive licence) · get_code("bf2344982180ea9a")
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 os
import sys

PYTHON_VERSION = f'py{sys.version_info.major}.{sys.version_info.minor}'

CACHE_DIR = os.environ.get('SAMGEO_CACHE_DIR') or os.environ.get('SAMGEO_VENV_DIR') or os.path.expanduser('~/.qgis_samgeo')

VENV_DIR = os.path.join(CACHE_DIR, f'venv_{PYTHON_VERSION}')

def get_venv_python_path(venv_dir: str=None) -> str:
    """Get the Python executable path within the venv.

    Args:
        venv_dir: Optional venv directory path. Uses VENV_DIR if None.

    Returns:
        Path to the venv Python executable.
    """
    if venv_dir is None:
        venv_dir = VENV_DIR
    if sys.platform == 'win32':
        return os.path.join(venv_dir, 'Scripts', 'python.exe')
    else:
        return os.path.join(venv_dir, 'bin', 'python3')


# Test with None (using default VENV_DIR)
ARGS = {
    'venv_dir': None
}
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 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
get_venv_site_packages Ran
ran on a synthesized input
opengeos/segment-geospatial/qgis-samgeo-plugin/core/venv_manager.py
code served (permissive licence) · get_code("8a3b4a2057fb6a95")
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 os
import sys
import tempfile

# Create a temporary directory structure to simulate a venv
temp_venv_dir = tempfile.mkdtemp()

# Create the directory structure for both Windows and Unix-like systems
if sys.platform == 'win32':
    lib_site_packages = os.path.join(temp_venv_dir, 'Lib', 'site-packages')
else:
    py_version = f'python{sys.version_info.major}.{sys.version_info.minor}'
    lib_site_packages = os.path.join(temp_venv_dir, 'lib', py_version, 'site-packages')

os.makedirs(lib_site_packages, exist_ok=True)

# Define arguments for the function
ARGS = {
    'venv_dir': temp_venv_dir
}
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 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
get_version_from_metadata Ran
ran on a synthesized input
opengeos/segment-geospatial/package_plugin.py
code served (permissive licence) · get_code("fe48a327eadd9dda")
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.

from pathlib import Path
import tempfile
import os

# Create a temporary directory with a metadata.txt file
temp_dir = tempfile.mkdtemp()
plugin_dir = Path(temp_dir)

# Create a metadata.txt file with a version entry
metadata_file = plugin_dir / 'metadata.txt'
with metadata_file.open('w', encoding='utf-8') as f:
    f.write('name=TestPlugin\n')
    f.write('version=1.2.3\n')
    f.write('author=Test\n')

ARGS = {
    'plugin_dir': plugin_dir
}
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 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
should_exclude_dir Ran
ran on a synthesized input
opengeos/segment-geospatial/package_plugin.py
code served (permissive licence) · get_code("d402e4d232f6f131")
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.

# Construct arguments for should_exclude_dir function
# The function takes a single parameter: dirname (str)
# It checks if the dirname starts with '.', is in EXCLUDE_DIRS, or ends with '.egg-info'

ARGS = {
    'dirname': '__pycache__'
}
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 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
should_exclude_file Ran
ran on a synthesized input
opengeos/segment-geospatial/package_plugin.py
code served (permissive licence) · get_code("6f793c7ce45104ba")
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 re

EXCLUDE_PATTERNS = ['^ui_.*\\.py$', '^resources_rc\\.py$', '^.*_rc\\.py$', '^.*\\.pyc$', '^.*\\.pyo$', '^.*\\.bak$', '^.*~$', '^\\..*\\.swp$', '^.*\\.orig$', '^package_plugin\\.py$']

def should_exclude_file(filename: str) -> bool:
    return any((re.match(pattern, filename) for pattern in EXCLUDE_PATTERNS))


ARGS = {
    "filename": "ui_dialog.py"
}
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 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

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 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 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.

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

Segmentation is an essential step for remote sensing image processing. This study aims to advance the application of the Segment Anything Model (SAM), an innovative image segmentation model by Meta AI, in the field of remote sensing image analysis. SAM is known for its exceptional generalization capabilities and zero-shot learning, making it a promising approach to processing aerial and orbital images from diverse geographical contexts. Our exploration involved testing SAM across multi-scale datasets using various input prompts, such as bounding boxes, individual points, and text descriptors. To enhance the model's performance, we implemented a novel automated technique that combines a text-prompt-derived general example with one-shot training. This adjustment resulted in an improvement in accuracy, underscoring SAM's potential for deployment in remote sensing imagery and reducing the need for manual annotation. Despite the limitations encountered with lower spatial resolution images, SAM exhibits promising adaptability to remote sensing data analysis. We recommend future research to enhance the model's proficiency through integration with supplementary fine-tuning techniques and other networks. Furthermore, we provide the open-source code of our modifications on online repositories, encouraging further and broader adaptations of SAM to the remote sensing domain.

For agents

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

get_harvested_code_for_paper("2306.16623")
get_code_for_paper("2306.16623")
have("2306.16623")

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

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

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

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

Connect an agent — have() is free.