SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.19783 · NeurIPS · 2024

Instruction-Guided Visual Masking

Jingjing Liu, Sijie Cheng, Yu Liu, Xianyuan Zhan, Jianxiong Li, Yinan Zheng, Jinliang Zheng, Jihao Liu, Mmlab, Jiaming Li, Tsinghua Air

arXiv · PDF · Open in the Atlas

Code that ran

20 of 28 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (7 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 11 failures of our instrument; 8 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/2405.19783.json · badge: /api/ran/2405.19783.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
2toinf/ivm canonical (classifier label)
classifier basis: classifier_2025
14 ran · 6 no recorded run
2toinf/IVM canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
FunctionStatusWhere it lives
Attention Ran
ran on a synthesized input · constructed an object; no result was computed
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("b5bf903edd1dcafd")
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 an instance of its own class, Attention: the run constructed the object and did not call it, so no result was computed. 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 = {
    "dim": 8,
    "num_heads": 2,
    "qkv_bias": True,
    "use_rel_pos": True,
    "rel_pos_zero_init": True,
    "input_size": (4, 3),
}
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 Attention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Attention 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
ConditionedMaskDecoder Ran
ran on a synthesized input · constructed an object; no result was computed
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("256eb3b402dbb02a")
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 an instance of its own class, ConditionedMaskDecoder: the run constructed the object and did not call it, so no result was computed. 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
import numpy as np
from typing import Type

torch.manual_seed(0)

# Build a minimal transformer that satisfies the interface used in ConditionedMaskDecoder
class MinimalTransformer(nn.Module):
    def __init__(self, dim: int):
        super().__init__()
        self.dim = dim
        self.linear = nn.Linear(dim, dim)
    
    def forward(self, x):
        return self.linear(x)

# Define the arguments dictionary
ARGS = {
    'transformer_dim': 256,
    'transformer': MinimalTransformer(256),
    'activation': nn.GELU,
    'image_embedding_size': (64, 64),
    'learnable_token_num': 32,
}
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 ConditionedMaskDecoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ConditionedMaskDecoder 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
LayerNorm2d Ran
ran on a synthesized input · constructed an object; no result was computed
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("738b5dcde12052ba")
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 an instance of its own class, LayerNorm2d: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# The LayerNorm2d class expects:
# - num_channels: int - the number of channels
# - eps: float (optional) - small value for numerical stability
# 
# The forward method expects:
# - x: torch.Tensor with shape (batch, num_channels, height, width)
#
# The forward method uses:
# - x.mean(1, keepdim=True) - mean over channel dimension
# - (x - u).pow(2).mean(1, keepdim=True) - variance
# - self.weight[:, None, None] and self.bias[:, None, None] - broadcasting

num_channels = 4
batch_size = 2
height = 3
width = 5

# Create a sample input tensor
x = torch.randn(batch_size, num_channels, height, width)

ARGS = {
    'num_channels': num_channels,
    'eps': 1e-06
}
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 LayerNorm2d — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LayerNorm2d 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
MLP Ran
ran on a synthesized input · constructed an object; no result was computed
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("d0650d05ab2c4a12")
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 an instance of its own class, MLP: the run constructed the object and did not call it, so no result was computed. 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 = {
    "input_dim": 4,
    "hidden_dim": 8,
    "output_dim": 3,
    "num_layers": 2,
    "sigmoid_output": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MLP — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MLP 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
MLPBlock Ran
ran on a synthesized input · constructed an object; no result was computed
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("1da9d87f536d9241")
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 an instance of its own class, MLPBlock: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

ARGS = {
    "embedding_dim": 4,
    "mlp_dim": 8,
    "act": nn.GELU,
}
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 MLPBlock — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MLPBlock 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
PatchEmbed Ran
ran on a synthesized input · constructed an object; no result was computed
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("7ed2e6b526e58fd3")
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 an instance of its own class, PatchEmbed: the run constructed the object and did not call it, so no result was computed. 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 = {
    "kernel_size": (16, 16),
    "stride": (16, 16),
    "padding": (0, 0),
    "in_chans": 3,
    "embed_dim": 768,
}
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 PatchEmbed — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PatchEmbed 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
PositionEmbeddingRandom Ran
ran on a synthesized input · constructed an object; no result was computed
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("2cb4a7bc53ea5022")
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 an instance of its own class, PositionEmbeddingRandom: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from typing import Tuple, Optional

torch.manual_seed(0)

ARGS = {
    'num_pos_feats': 64,
    'scale': 1.0
}
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 PositionEmbeddingRandom — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PositionEmbeddingRandom 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
add_decomposed_rel_pos Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("30cb45bcc9fc27d0")
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) and returned Tensor, ndim 3, dtype family float, shape (2, 20, 18) 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)

# Define dimensions
B = 2  # batch size
q_h, q_w = 4, 5  # query spatial dimensions
k_h, k_w = 3, 6  # key spatial dimensions
C = 8  # channel dimension

# Create attention tensor: (B, q_h * q_w, k_h * k_w)
attn = torch.randn(B, q_h * q_w, k_h * k_w)

# Create query tensor: (B, q_h * q_w, C)
q = torch.randn(B, q_h * q_w, C)

# Create relative position embeddings for height
# Initial size should be reasonable for interpolation
rel_pos_h = torch.randn(2 * max(q_h, k_h) - 1, C)

# Create relative position embeddings for width
rel_pos_w = torch.randn(2 * max(q_w, k_w) - 1, C)

# Define sizes as tuples
q_size = (q_h, q_w)
k_size = (k_h, k_w)

ARGS = {
    "attn": attn,
    "q": q,
    "rel_pos_h": rel_pos_h,
    "rel_pos_w": rel_pos_w,
    "q_size": q_size,
    "k_size": k_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 20, 18) — shape (2, 20, 18) 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
apply_mask_to_rgb Ran
ran; our contract draft was wrong, not the code
2toinf/IVM/model/llava_encoder.py
code served (permissive licence) · get_code("3a06fee7a1f09df9")
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 Image. 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 PIL import Image
import numpy as np

torch.manual_seed(0)

# Create a small RGB PIL Image
# Create image data as numpy array
img_array = np.random.randint(0, 256, (4, 5, 3), dtype=np.uint8)
image = Image.fromarray(img_array, mode='RGB')

# Create a binary mask tensor of shape (height, width)
mask = torch.randint(0, 2, (4, 5), dtype=torch.float32)

# Define fill color
fill_color = (255, 255, 255)

ARGS = {
    'image': image,
    'mask': mask,
    'fill_color': fill_color
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
dice_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("d91fd9b31c41684e")
How it ran

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

import torch

torch.manual_seed(0)

# Create small tensors for inputs and targets
# inputs: shape (batch=2, channels=1, height=4, width=3)
# targets: shape (batch=2, channels=1, height=4, width=3)
inputs = torch.randn(2, 1, 4, 3)
targets = torch.randint(0, 2, (2, 1, 4, 3)).float()

ARGS = {
    "inputs": inputs,
    "targets": targets,
    "scale": 1000,
    "eps": 1e-06,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
generate_boxes_mask Ran
ran, honoured the contract we drafted
2toinf/IVM/utils.py
code served (permissive licence) · get_code("33b1f0add9c27a54")
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 float, shape (256, 256) 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

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

# Define arguments for generate_boxes_mask
ARGS = {
    "xmin": 0.1,
    "ymin": 0.2,
    "xmax": 0.7,
    "ymax": 0.8,
    "height": 256,
    "width": 256,
}
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 float, shape (256, 256) — shape (256, 256) 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_rel_pos Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
2toinf/IVM/model/sam_components/image_encoder.py
code served (permissive licence) · get_code("733d7f0bedcb74c2")
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) and returned Tensor, ndim 3, dtype family float, shape (3, 4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small relative position embedding tensor
# Shape: (L, C) where L is the sequence length and C is the channel dimension
# Using a small size that will be resized by the function
rel_pos = torch.randn(5, 4)  # 5 positions, 4 channels

# Define query and key sizes
q_size = 3
k_size = 4

ARGS = {
    "q_size": q_size,
    "k_size": k_size,
    "rel_pos": rel_pos,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (3, 4, 4) — shape (3, 4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_rel_pos Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("5cf5ba2c32195b02")
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 3, dtype family float, shape (3, 2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small relative position embedding tensor
# Shape: (L, C) where L is length and C is channels
rel_pos = torch.randn(7, 4)  # Small embedding table

# Define parameters for the function
q_size = 3
k_size = 2

ARGS = {
    "q_size": q_size,
    "k_size": k_size,
    "rel_pos": rel_pos,
}
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 3, dtype family float, shape (3, 2, 4) — shape (3, 2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
llavaTextPreprocess Ran
ran; our contract draft was wrong, not the code
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("eeb6e13ac80aed43")
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

torch.manual_seed(0)

# The function takes two parameters: ins (a string) and role (a string with default 'policy')
# Based on the function body:
# - ins must be a string
# - role must be one of: 'policy', 'discriminator', 'complex_policy'

ARGS = {
    'ins': 'Pick up the red cube and place it on the shelf',
    'role': 'policy'
}
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 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
read_masks Ran
ran, honoured the contract we drafted
2toinf/IVM/IVM_1M_Mix/datareader.py
code served (permissive licence) · get_code("7e8dcee39799a2b0")
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 float, 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 cv2
import numpy as np
import tempfile
import os

# Create a temporary mask image file
temp_dir = tempfile.mkdtemp()
mask_path = os.path.join(temp_dir, "test_mask.png")

# Create a simple test image with varying intensities
test_image = np.random.randint(50, 200, (100, 100, 3), dtype=np.uint8)
cv2.imwrite(mask_path, test_image)

ARGS = {
    "mask_path": mask_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 2, dtype family float, 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
sigmoid_ce_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("1033e9116b1e2573")
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 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors with distinct dimensions for batch and spatial/channel dims
# inputs and targets should have the same shape for binary_cross_entropy_with_logits
batch_size = 2
spatial_dim_1 = 4
spatial_dim_2 = 3

# inputs: logits tensor, shape (batch, height, width) or similar
inputs = torch.randn(batch_size, spatial_dim_1, spatial_dim_2)

# targets: binary targets, same shape as inputs
targets = torch.randint(0, 2, (batch_size, spatial_dim_1, spatial_dim_2)).float()

ARGS = {
    'inputs': inputs,
    'targets': targets,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
window_partition Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("89c1f2e801f0e941")
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) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small input tensor with shape [B, H, W, C]
# B=2 (batch), H=3 (height), W=5 (width), C=4 (channels)
x = torch.randn(2, 3, 5, 4)

# Window size
window_size = 2

ARGS = {
    "x": x,
    "window_size": window_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
window_partition Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
2toinf/IVM/model/sam_components/image_encoder.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from LeapLabTHU/EchoWorld, is pointer only (licence: NONE) · get_code("105fa08885dc36cc")
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 LeapLabTHU/EchoWorld, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

window_unpartition Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("3ade8cb3a2133a3f")
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) and returned Tensor, ndim 4, dtype family float, shape (2, 7, 11, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct arguments for window_unpartition
# The function expects:
# - windows: tensor of shape [B * num_windows, window_size, window_size, C]
# - window_size: int
# - pad_hw: Tuple[int, int] - padded height and width
# - hw: Tuple[int, int] - original height and width

window_size = 4
C = 3  # channels
B = 2  # batch size

# Calculate padded dimensions (should be multiples of window_size)
Hp = 8  # padded height
Wp = 12  # padded width

# Original dimensions (before padding)
H = 7
W = 11

# Number of windows in each dimension
num_windows_h = Hp // window_size  # 2
num_windows_w = Wp // window_size  # 3
num_windows = num_windows_h * num_windows_w  # 6

# Total number of window tensors: B * num_windows
total_windows = B * num_windows  # 2 * 6 = 12

# Create windows tensor of shape [B * num_windows, window_size, window_size, C]
windows = torch.randn(total_windows, window_size, window_size, C)

pad_hw = (Hp, Wp)
hw = (H, W)

ARGS = {
    "windows": windows,
    "window_size": window_size,
    "pad_hw": pad_hw,
    "hw": hw,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 7, 11, 3) — shape (2, 7, 11, 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
window_unpartition Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
2toinf/IVM/model/sam_components/image_encoder.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("27be441cc8213e52")
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. A run is recorded.

Block Not yet run
unverified (harvested, no recorded run)
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("2dcf225b97d045ae")
How it ran

no invocation recorded.

IVM Not yet run
unverified (harvested, no recorded run)
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("28446a46dff45e88")
How it ran

no invocation recorded.

ImageEncoderViT Not yet run
unverified (harvested, no recorded run)
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("d930ca853fbfe859")
How it ran

no invocation recorded.

LLaVAEncoder Not yet run
unverified (harvested, no recorded run)
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("d6c5069b5e0fd935")
How it ran

no invocation recorded.

TwoWayAttentionBlock Not yet run
unverified (harvested, no recorded run)
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("718ac29e8d9232bb")
How it ran

no invocation recorded.

TwoWayTransformer Not yet run
unverified (harvested, no recorded run)
2toinf/ivm/model/IVM.py
code served (permissive licence) · get_code("227d8c19ab9e7cbb")
How it ran

no invocation recorded.

auto_postprocess Not yet run
unverified (harvested, no recorded run)
2toinf/IVM/IVM.py
code served (permissive licence) · get_code("58ede5faa9cd2f1c")
How it ran

no invocation recorded.

forward_batch Not yet run
unverified (harvested, no recorded run)
2toinf/IVM/IVM.py
code served (permissive licence) · get_code("1f0e4db7df0cd3fe")
How it ran

no invocation recorded.

Also present in other papers' code

Of 28 samples lifted from this paper's linked repositories, 28 carry a function identity and 0 do not. Of the 25 distinct functions with an identity, 13 are also present in other papers whose code we hold (11 with at least one paper dated earlier, 3 the same month, 13 later) and 12 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
get_rel_pos
brick of this paper's assembly: helper
47 other papers
30 dated earlier, 2 the same month, 13 later, 2 same year, order not determinable · 5 only as an assembly brick
2304.02643 (2023-04)
Segment Anything
2304.06790 (2023-04)
Inpaint Anything: Segment Anything Meets Image Inpainting
2304.12306 (2023-04)
Segment Anything in Medical Images
and 44 more not named here
window_partition
brick of this paper's assembly: helper
47 other papers
29 dated earlier, 2 the same month, 14 later, 2 same year, order not determinable · 1 only as an assembly brick
2304.02643 (2023-04)
Segment Anything
2304.06790 (2023-04)
Inpaint Anything: Segment Anything Meets Image Inpainting
2304.12306 (2023-04)
Segment Anything in Medical Images
and 44 more not named here
window_unpartition
brick of this paper's assembly: helper
46 other papers
29 dated earlier, 2 the same month, 13 later, 2 same year, order not determinable · 1 only as an assembly brick
2304.02643 (2023-04)
Segment Anything
2304.06790 (2023-04)
Inpaint Anything: Segment Anything Meets Image Inpainting
2304.12306 (2023-04)
Segment Anything in Medical Images
and 43 more not named here
LayerNorm2d
brick of this paper's assembly: helper
12 other papers
6 dated earlier, 6 later · 10 only as an assembly brick
2306.01567 (2023-06)
Segment Anything in High Quality
2312.05284 (2023-12)
SlimSAM: 0.1% Data Makes Segment Anything Slim
2401.08083 (2024-01)
UV-SAM: Adapting Segment Anything Model for Urban Village Identification
and 9 more not named here
MLPBlock
brick of this paper's assembly: helper
8 other papers
4 dated earlier, 4 later · 3 only as an assembly brick
2207.05042 (2022-07)
Audio-Visual Segmentation
2306.01567 (2023-06)
Segment Anything in High Quality
2401.08083 (2024-01)
UV-SAM: Adapting Segment Anything Model for Urban Village Identification
and 5 more not named here
MLP
brick of this paper's assembly: helper
7 other papers
4 dated earlier, 3 later · 4 only as an assembly brick
2306.01567 (2023-06)
Segment Anything in High Quality
2401.08083 (2024-01)
UV-SAM: Adapting Segment Anything Model for Urban Village Identification
2403.18271 (2024-03)
Unleashing the Potential of SAM for Medical Adaptation via Hierarchical Decoding
and 4 more not named here
add_decomposed_rel_pos
brick of this paper's assembly: helper
7 other papers
4 dated earlier, 3 later · 1 only as an assembly brick
2306.01567 (2023-06)
Segment Anything in High Quality
2312.05284 (2023-12)
SlimSAM: 0.1% Data Makes Segment Anything Slim
2401.08083 (2024-01)
UV-SAM: Adapting Segment Anything Model for Urban Village Identification
and 4 more not named here
Attention
brick of this paper's assembly: helper
6 other papers
3 dated earlier, 3 later · 1 only as an assembly brick
2306.01567 (2023-06)
Segment Anything in High Quality
2401.08083 (2024-01)
UV-SAM: Adapting Segment Anything Model for Urban Village Identification
2404.15700 (2024-04)
MAS-SAM: Segment Any Marine Animal with Aggregated Features
and 3 more not named here
PatchEmbed
brick of this paper's assembly: helper
6 other papers
3 dated earlier, 3 later · 1 only as an assembly brick
2306.01567 (2023-06)
Segment Anything in High Quality
2401.08083 (2024-01)
UV-SAM: Adapting Segment Anything Model for Urban Village Identification
2404.15700 (2024-04)
MAS-SAM: Segment Any Marine Animal with Aggregated Features
and 3 more not named here
Block
brick of this paper's assembly: helper
5 other papers
2 dated earlier, 3 later · 1 only as an assembly brick
2306.01567 (2023-06)
Segment Anything in High Quality
2401.08083 (2024-01)
UV-SAM: Adapting Segment Anything Model for Urban Village Identification
2503.16997 (2025-03)
Steady Progress Beats Stagnation: Mutual Aid of Foundation and Conventional Models in Mixed Domain Semi-Supervised Medical Image Segmentation
and 2 more not named here
ImageEncoderViT
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later
2306.01567 (2023-06)
Segment Anything in High Quality
2503.16997 (2025-03)
Steady Progress Beats Stagnation: Mutual Aid of Foundation and Conventional Models in Mixed Domain Semi-Supervised Medical Image Segmentation
TwoWayTransformer
brick of this paper's assembly: helper
2 other papers
2 later · 1 only as an assembly brick
2408.00714 (2024-08)
SAM 2: Segment Anything in Images and Videos
2506.01304 (2025-06)
SAM-I2V: Upgrading SAM to Support Promptable Video Segmentation with Less than 0.2% Training Cost
TwoWayAttentionBlock
brick of this paper's assembly: helper
1 other paper
1 later
2606.27655 (2026-06)
Temporal-Emerged Prompting for Segment Anything in Multiframe Infrared Small Target Detection

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

Instruction following is crucial in contemporary LLM. However, when extended to multimodal setting, it often suffers from misalignment between specific textual instruction and targeted local region of an image. To achieve more accurate and nuanced multimodal instruction following, we introduce Instruction-guided Visual Masking (IVM), a new versatile visual grounding model that is compatible with diverse multimodal models, such as LMM and robot model. By constructing visual masks for instruction-irrelevant regions, IVM-enhanced multimodal models can effectively focus on task-relevant image regions to better align with complex instructions. Specifically, we design a visual masking data generation pipeline and create an IVM-Mix-1M dataset with 1 million image-instruction pairs. We further introduce a new learning technique, Discriminator Weighted Supervised Learning (DWSL) for preferential IVM training that prioritizes high-quality data samples. Experimental results on generic multimodal tasks such as VQA and embodied robotic control demonstrate the versatility of IVM, which as a plug-and-play tool, significantly boosts the performance of diverse multimodal models, yielding new state-of-the-art results across challenging multimodal benchmarks. Code, model and data are available at https://github.com/2toinf/IVM.

For agents

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

get_harvested_code_for_paper("2405.19783")
get_code_for_paper("2405.19783")
have("2405.19783")

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

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

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

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

Connect an agent — have() is free.