SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · ijcai2025_0179 · IJCAI · 2025

Squeezing Context into Patches: Towards Memory-Efficient Ultra-High Resolution Semantic Segmentation

Shutao Li, Wang Liu, Puhong Duan, Xudong Kang

Code that ran

8 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; 8 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/ijcai2025_0179.json · badge: /api/ran/ijcai2025_0179.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
StuLiu/SCPSeg canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
Color2Index Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
StuLiu/SCPSeg/convert_datasets/convert_gid.py
code served (permissive licence) · get_code("dc5c50bc48fb516e")
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 (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 numpy as np

# Create a small color label image (height=4, width=3, channels=3)
# Each pixel has RGB values that should map to one of the GID_COLORMAP colors
ColorLabel = np.array([
    [[0, 0, 0], [200, 0, 0], [250, 0, 150]],
    [[200, 150, 150], [250, 150, 150], [0, 200, 0]],
    [[150, 250, 0], [150, 200, 150], [200, 0, 200]],
    [[150, 0, 250], [150, 150, 250], [250, 200, 0]]
], dtype=np.uint8)

ARGS = {
    "ColorLabel": ColorLabel
}
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 ndarray, ndim 2, dtype family int, shape (4, 3) — shape (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
conv1x1 Ran
ran; our contract draft was wrong, not the code
StuLiu/SCPSeg/semseg/models/WiCoNet.py
code served (permissive licence) · get_code("53be362ca24f8c9e")
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 Conv2d. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
StuLiu/SCPSeg/semseg/models/WiCoNet.py
pointer only (licence: MIT); the stored copy get_code serves, from amerch/CIFAR100-Training, is pointer only (licence: NONE) · get_code("583f9780bdd00a45")
How it ran

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

cosine_similarity_surrounding Ran
ran; our contract draft was wrong, not the code
StuLiu/SCPSeg/semseg/losses.py
code served (permissive licence) · get_code("7bb37d02e723522d")
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, 49, 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 torch.nn.functional as F

torch.manual_seed(0)

# Construct a small input tensor
# Shape: (batch_size=2, channels=4, height=3, width=3)
input_tensor = torch.randn(2, 4, 3, 3)

ARGS = {
    "input": input_tensor,
    "kernel_size": 7
}
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, 49, 3, 3) — shape (2, 49, 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
get_loss Ran
ran; our contract draft was wrong, not the code
StuLiu/SCPSeg/semseg/losses.py
code served (permissive licence) · get_code("2b6ef0ff8f3ce5ed")
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 Dice. 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
from torch import nn, Tensor

torch.manual_seed(0)

ARGS = {
    'loss_fn_name': 'Dice',
    'ignore_label': 255,
    'cls_weights': None,
}
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 Dice — a Dice output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Dice 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_val_augmentation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
StuLiu/SCPSeg/semseg/augmentations.py
code served (permissive licence) · get_code("2fc0953f8539518f")
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 Compose. 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 albumentations
from albumentations.pytorch import ToTensorV2

torch.manual_seed(0)

# The function takes:
# - size: tuple/list of dimensions for Resize
# - mean: tuple of mean values for Normalize
# - std: tuple of std values for Normalize

ARGS = {
    "size": (224, 224),
    "mean": (0.485, 0.456, 0.406),
    "std": (0.229, 0.224, 0.225),
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
albumentations, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose output the recorded ndim 1 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_val_augmentation Ran
ran; our contract draft was wrong, not the code
StuLiu/SCPSeg/semseg/augmentations_torch.py
code served (permissive licence) · get_code("df0bc5cbc54171d2")
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 Compose. 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 torchvision.transforms.functional as TF
import math
from torch import Tensor
from typing import Tuple, List, Union, Optional, Iterable

torch.manual_seed(0)

class Compose:
    def __init__(self, transforms: list) -> None:
        self.transforms = transforms

    def __call__(self, img: Tensor, mask: Tensor) -> Tuple[Tensor, Tensor]:
        if mask.ndim == 2:
            assert img.shape[1:] == mask.shape
        else:
            assert img.shape[1:] == mask.shape[1:]
        for transform in self.transforms:
            img, mask = transform(img, mask)
        return (img, mask)

class Normalize:
    def __init__(self, mean: Union[list, tuple]=(0.485, 0.456, 0.406), std: Union[list, tuple]=(0.229, 0.224, 0.225)):
        self.mean = mean
        self.std = std

    def __call__(self, img: Tensor, mask: Tensor) -> Tuple[Tensor, Tensor]:
        img = img.float()
        img /= 255
        img = TF.normalize(img, self.mean, self.std)
        return (img, mask)

class Resize:
    def __init__(self, size: Union[int, Tuple[int], List[int]]) -> None:
        self.size = size

    def __call__(self, img: Tensor, mask: Tensor) -> Tuple[Tensor, Tensor]:
        H, W = img.shape[1:]
        if isinstance(self.size, int):
            scale_factor = self.size / min(H, W)
            nH, nW = (round(H * scale_factor), round(W * scale_factor))
        else:
            nH, nW = self.size[:2]
        alignH, alignW = (int(math.ceil(nH / 32)) * 32, int(math.ceil(nW / 32)) * 32)
        img = TF.resize(img, [alignH, alignW], TF.InterpolationMode.BILINEAR)
        mask = TF.resize(mask, [alignH, alignW], TF.InterpolationMode.NEAREST)
        return (img, mask)

def get_val_augmentation(size, mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)):
    return Compose([Resize(size), Normalize(mean, std)])

ARGS = {
    "size": 128,
    "mean": (0.485, 0.456, 0.406),
    "std": (0.229, 0.224, 0.225)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose 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
read_origin_data Ran
ran; our contract draft was wrong, not the code
StuLiu/SCPSeg/convert_datasets/convert_gid.py
code served (permissive licence) · get_code("48667ef7520944d7")
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 os
import os.path as osp
import tempfile
import numpy as np
import skimage.io as sio

# Create a temporary directory structure with mock data
temp_dir = tempfile.mkdtemp()
img_dir = osp.join(temp_dir, 'image_NirRGB')
lbl_dir = osp.join(temp_dir, 'label_15classes')
os.makedirs(img_dir, exist_ok=True)
os.makedirs(lbl_dir, exist_ok=True)

# File names from the function
file_names = ['GF2_PMS1__L1A0001064454-MSS1', 'GF2_PMS1__L1A0001395956-MSS1', 'GF2_PMS1__L1A0001680858-MSS1', 'GF2_PMS2__L1A0001378501-MSS2', 'GF2_PMS2__L1A0001517494-MSS2', 'GF2_PMS1__L1A0001118839-MSS1', 'GF2_PMS2__L1A0000718813-MSS2', 'GF2_PMS2__L1A0001471436-MSS2', 'GF2_PMS2__L1A0001787564-MSS2', 'GF2_PMS2__L1A0001821754-MSS2']

# Create mock image and label files
for file_name in file_names:
    # Create mock NirRGB image (4 channels, height 32, width 32)
    img_data = np.random.randint(0, 256, (32, 32, 4), dtype=np.uint8)
    img_path = osp.join(img_dir, f'{file_name}.tif')
    sio.imsave(img_path, img_data)
    
    # Create mock label image with color values from GID_COLORMAP
    # Use RGB colors that map to valid class indices
    lbl_data = np.zeros((32, 32, 3), dtype=np.uint8)
    # Fill with first few colormap entries to ensure valid colors
    colormap = [[0, 0, 0], [200, 0, 0], [250, 0, 150], [200, 150, 150]]
    for i in range(32):
        for j in range(32):
            color = colormap[(i + j) % len(colormap)]
            lbl_data[i, j] = color
    lbl_path = osp.join(lbl_dir, f'{file_name}_label.tif')
    sio.imsave(lbl_path, lbl_data)

ARGS = {
    'data_dir': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, skimage — 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_train_augmentation Not yet run
unverified (harvested, no recorded run)
StuLiu/SCPSeg/semseg/augmentations_torch.py
code served (permissive licence) · get_code("30e747a6f97d381b")
How it ran

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, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 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
conv3x3 686 other papers
659 dated earlier, 13 later, 14 same year, order not determinable · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
get_loss 1 other paper
1 dated earlier
2303.01480 (2023-03)
Delivering Arbitrary-Modal Semantic Segmentation

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

Segmenting ultra-high-resolution (UHR) images poses a significant challenge due to constraints on GPU memory, leading to a trade-off between detailed local information and a comprehensive contextual understanding. Current UHR methods often employ a multi-branch encoder to handle local and contextual information, which can be memoryintensive. To address the need for both high accuracy and low memory usage in processing UHR images, we introduce a memory-efficient semantic segmentation approach by squeezing context information into local patches (SCPSeg). Our method integrates the processing of local and contextual information within a single-branch encoder. Specifically, we introduce a context squeezing module (CSM) designed to compress global context details into local patches, enabling segmentation networks to perceive broader image contexts. Additionally, we propose a super-resolution guided local feature alignment (LFA) technique to improve segmentation precision by aligning local feature relationships. This approach calculates similarities within sliding windows, avoiding heavy computational costs during the training phase. We evaluate the effectiveness of our proposed method on four widely used UHR segmentation benchmarks. Experimental results demonstrate that our approach enhances UHR segmentation accuracy without incurring additional memory overhead during the inference stage. The code is available at https://github.com/StuLiu/SCPSeg.

For agents

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

get_harvested_code_for_paper("ijcai2025_0179")
get_code_for_paper("ijcai2025_0179")
have("ijcai2025_0179")

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

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

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

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

Connect an agent — have() is free.