SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.16432 · 2023

Text-Driven Image Editing via Learnable Regions

arXiv · PDF · Open in the Atlas

Code that ran

13 of 15 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; 5 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 7 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2311.16432.json · badge: /api/ran/2311.16432.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
yuanze-lin/Learnable_Regions canonical (classifier label)
classifier basis: census
13 ran · 2 no recorded run
FunctionStatusWhere it lives
bool_flag Ran
ran, violated the contract we drafted
yuanze-lin/Learnable_Regions/models/dino_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from sthalles/MaSSL, is pointer only (licence: NONE) · get_code("c19231378e41dc5a")
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 sthalles/MaSSL, 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.

clip_gradients Ran
ran, honoured the contract we drafted
yuanze-lin/Learnable_Regions/models/dino_utils.py
code served (permissive licence) · get_code("2b5489053b222e00")
How it ran

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

import torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        return self.linear2(self.linear1(x))

model = SimpleModel()

# Create a simple forward pass and backward pass to populate gradients
x = torch.randn(2, 4)
y = torch.randn(2, 2)
output = model(x)
loss = nn.MSELoss()(output, y)
loss.backward()

clip = 1.0

ARGS = {
    "model": model,
    "clip": clip,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
cosine_scheduler Ran
ran, honoured the contract we drafted
yuanze-lin/Learnable_Regions/models/dino_utils.py
code served (permissive licence) · get_code("361a6b24f11fc50a")
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 ndarray, ndim 1, dtype family float, shape (500,) 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

ARGS = {
    "base_value": 0.1,
    "final_value": 0.001,
    "epochs": 10,
    "niter_per_ep": 50,
    "warmup_epochs": 2,
    "start_warmup_value": 0.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 1, dtype family float, shape (500,) — shape (500,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
draw_image_with_bbox_new Ran
ran; our contract draft was wrong, not the code
yuanze-lin/Learnable_Regions/models/utils.py
code served (permissive licence) · get_code("453cb98d3d856ead")
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.

from copy import deepcopy
import numpy as np
from PIL import Image, ImageDraw

class Bbox(object):

    def __init__(self, top_left_height_width: str) -> None:
        self.top, self.left, self.height, self.width = [int(x) for x in top_left_height_width.split('_')]

def draw_image_with_bbox_new(image: np.ndarray, bbox: Bbox) -> Image.Image:
    img = (deepcopy(image) * 255).astype(np.uint8)
    img = Image.fromarray(img)
    draw = ImageDraw.Draw(img)
    x1, y1, x2, y2 = (bbox.left, bbox.top, bbox.left + bbox.width, bbox.top + bbox.height)
    draw.rectangle(((x1, y1), (x2, y2)), outline=(255, 0, 0))
    return img

# Create a small test image as numpy array (normalized to [0, 1])
image = np.random.rand(32, 48, 3).astype(np.float32)

# Create a Bbox object
bbox = Bbox("10_5_15_20")

ARGS = {
    "image": image,
    "bbox": bbox
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — 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
drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yuanze-lin/Learnable_Regions/models/vision_transformer.py
pointer only (licence: MIT); the stored copy get_code serves, from gladzhang/Xformer, is pointer only (licence: NONE) · get_code("55120f2026b56aa2")
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 gladzhang/Xformer, 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.

generate Ran
ran; our contract draft was wrong, not the code
yuanze-lin/Learnable_Regions/engine.py
code served (permissive licence) · get_code("e4c34a449c58f4b7")
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 int, shape (2, 3, 512, 512) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 as nn
import torchvision.transforms as T
from PIL import Image

torch.manual_seed(0)

# Create a minimal mock pipe that satisfies the function's usage
class MockPipe(nn.Module):
    def __init__(self):
        super().__init__()
    
    def __call__(self, prompt, image, mask_image, generator):
        # Return a mock result with an images attribute
        # The function expects images to be a list of PIL Images
        mock_result = type('obj', (object,), {
            'images': [Image.new('RGB', (512, 512)) for _ in range(image.shape[0])]
        })()
        return mock_result

# Create mock tensors
# init_images: batch of images, shape should be (batch, channels, height, width)
init_images = torch.randn(2, 3, 256, 256)

# mask_images: batch of mask images, shape should be (batch, channels, height, width)
mask_images = torch.randn(2, 3, 256, 256)

# pipe: the inpainting pipeline
pipe = MockPipe()

# generator: torch random generator
generator = torch.Generator()
generator.manual_seed(0)

# prompt: list of text prompts
prompt = 'lion'

# device: device to use (CPU in this case)
device = 'cpu'

# strength: inpainting strength parameter
strength = 0.75

# guidance_scale: classifier-free guidance scale
guidance_scale = 7.5

# num_samples: number of samples to generate
num_samples = 1

# n_iter: number of iterations
n_iter = 1

ARGS = {
    'init_images': init_images,
    'mask_images': mask_images,
    'pipe': pipe,
    'generator': generator,
    'prompt': prompt,
    'device': device,
    'strength': strength,
    'guidance_scale': guidance_scale,
    'num_samples': num_samples,
    'n_iter': n_iter
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, torch, torchvision — 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 int, shape (2, 3, 512, 512) — shape (2, 3, 512, 512) 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_hyper Ran
ran; our contract draft was wrong, not the code
yuanze-lin/Learnable_Regions/models/configs/base_config.py
code served (permissive licence) · get_code("ffc38a27fd9393ba")
How it ran

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

import torch

class MockHyperparameter:
    def __init__(self):
        self.sweeps = {}
        self.products = []
    
    def sweep(self, name, values):
        """Create a sweep over values"""
        self.sweeps[name] = values
        return {name: values}
    
    def product(self, sweeps, name=None):
        """Create a product of sweeps"""
        result = []
        for sweep in sweeps:
            if isinstance(sweep, dict):
                for key, values in sweep.items():
                    for value in values:
                        result.append({key: value})
        return result

h = MockHyperparameter()

ARGS = {
    'h': h
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_hyper Ran
ran; our contract draft was wrong, not the code
yuanze-lin/Learnable_Regions/models/configs/maskgit_class_cond_config.py
code served (permissive licence) · get_code("7dfd4d71b4b83843")
How it ran

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

import torch
import torch.nn as nn


class HyperparameterConfig:
    """Stand-in class for hyperparameter configuration object."""
    
    def __init__(self):
        self.params = {}
    
    def sweep(self, key, values):
        """Mock sweep method that stores sweep configuration."""
        return {'key': key, 'values': values}
    
    def product(self, sweeps, name=None):
        """Mock product method that combines sweeps."""
        return {
            'type': 'product',
            'sweeps': sweeps,
            'name': name
        }


h = HyperparameterConfig()

ARGS = {
    'h': h
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_mask_imgs Ran
ran; our contract draft was wrong, not the code
yuanze-lin/Learnable_Regions/vis.py
code served (permissive licence) · get_code("093d16a618f12c98")
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 5, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Analyze the function:
# - imgs: tensor that gets repeat_interleave'd, indexed by [i], and has shape accessed
# - bboxs: tensor with shape[0], indexed by [i], contains bbox coordinates at indices [0], [1], [2], [3]
#   The bboxs[i] elements are converted to int and .item() is called, so they're scalars
#   bbox format appears to be [x1, y1, x2, y2]
#   The function slices imgs[i][:, y1:y2, x1:x2], suggesting imgs is (batch, channels, height, width)

# Create small tensors:
# imgs: (2, 3, 8, 8) - batch=2, channels=3, height=8, width=8
imgs = torch.randint(0, 256, (2, 3, 8, 8), dtype=torch.uint8)

# bboxs: (4, 4) - 4 bboxes, each with [x1, y1, x2, y2]
# Need 4 bboxes because imgs will be repeat_interleave'd to match bboxs.shape[0]
# So 4 // 2 = 2 repetitions, resulting in 4 total
bboxs = torch.tensor([
    [1.0, 1.0, 5.0, 5.0],  # bbox 0: x1=1, y1=1, x2=5, y2=5
    [2.0, 2.0, 6.0, 6.0],  # bbox 1
    [1.0, 1.0, 5.0, 5.0],  # bbox 2
    [2.0, 2.0, 6.0, 6.0],  # bbox 3
], dtype=torch.float32)

ARGS = {
    'imgs': imgs,
    'bboxs': bboxs,
}
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 tuple, ndim 5, 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
inpaint Ran
ran; our contract draft was wrong, not the code
yuanze-lin/Learnable_Regions/engine.py
code served (permissive licence) · get_code("cdb9ed47e9d99d77")
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 int, shape (2, 3, 64, 64) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 as nn
from PIL import Image
import numpy as np

torch.manual_seed(0)

# Create a minimal mock pipe that mimics the StableDiffusionInpaintPipeline
class MockInpaintPipe(nn.Module):
    def __init__(self):
        super().__init__()
    
    def __call__(self, prompt, image, mask_image, generator):
        # Return a mock result object with .images attribute
        # Create 2 PIL images as output
        img_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
        pil_img = Image.fromarray(img_array)
        return type('obj', (object,), {'images': [pil_img, pil_img]})()

# Create mock pipe instance
pipe = MockInpaintPipe()

# Create prompts (list of strings)
prompts = ["a cat", "a dog"]

# Create init_images (list of PIL Images)
init_img_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
init_images = [Image.fromarray(init_img_array), Image.fromarray(init_img_array)]

# Create mask_images (list of PIL Images in grayscale)
mask_array = np.random.randint(0, 256, (64, 64), dtype=np.uint8)
mask_images = [Image.fromarray(mask_array, mode='L'), Image.fromarray(mask_array, mode='L')]

# Create latents (small tensor, optional)
latents = torch.randn(2, 4, 8, 8)

# Create generator (torch.Generator or None)
generator = torch.Generator()
generator.manual_seed(42)

ARGS = {
    'pipe': pipe,
    'prompts': prompts,
    'init_images': init_images,
    'mask_images': mask_images,
    'latents': latents,
    'strength': 0.75,
    'guidance_scale': 7.5,
    'generator': generator,
    'num_samples': 1,
    'n_iter': 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — 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 int, shape (2, 3, 64, 64) — shape (2, 3, 64, 64) 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
map_cooridates Ran
ran, honoured the contract we drafted
yuanze-lin/Learnable_Regions/vis.py
code served (permissive licence) · get_code("0204b4ac0f24e7da")
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
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - bbox: used in arithmetic operations (subtraction, multiplication)
#   should be a tensor or array-like numeric value
# - min_num: numeric, default 0
# - max_num: numeric, default 255
# The function performs linear scaling/mapping of bbox values

# Create a small tensor for bbox (batch of 2, with 4 coordinates)
bbox = torch.tensor([[10.0, 20.0, 30.0, 40.0],
                      [50.0, 60.0, 70.0, 80.0]])

ARGS = {
    "bbox": bbox,
    "min_num": 0,
    "max_num": 255
}
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 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
read_image Ran
ran, honoured the contract we drafted
yuanze-lin/Learnable_Regions/models/utils.py
code served (permissive licence) · get_code("282a17731f89f0e7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family float, shape (64, 48, 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 tempfile
import numpy as np
from PIL import Image

# Create a temporary test image file
temp_dir = tempfile.gettempdir()
test_image_path = f"{temp_dir}/test_image.jpg"

# Create a simple RGB image and save it
test_img = Image.new('RGB', (100, 80), color=(255, 128, 64))
test_img.save(test_image_path)

# Define ARGS dict with all parameters
ARGS = {
    'file_path': test_image_path,
    'height': 64,
    'width': 48
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (64, 48, 3) — shape (64, 48, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_image_from_url Ran
ran, honoured the contract we drafted
yuanze-lin/Learnable_Regions/models/utils.py
code served (permissive licence) · get_code("efd2201f1bea3f5a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family float, shape (64, 128, 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 io
import numpy as np
from unittest.mock import Mock, patch
from PIL import Image

# Create a small test image in memory
def create_test_image_bytes(width=100, height=80):
    """Create a small RGB image and return as bytes"""
    img = Image.new('RGB', (width, height), color='red')
    img_bytes = io.BytesIO()
    img.save(img_bytes, format='PNG')
    img_bytes.seek(0)
    return img_bytes.getvalue()

# Mock the requests.get to return image data without actual network calls
test_image_bytes = create_test_image_bytes(width=100, height=80)

mock_response = Mock()
mock_response.content = test_image_bytes
mock_response.raise_for_status = Mock(return_value=None)

ARGS = {
    'url': 'https://example.com/test_image.png',
    'height': 64,
    'width': 128
}

# Patch requests.get to return our mock response
import requests
requests.get = Mock(return_value=mock_response)
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, requests — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (64, 128, 3) — shape (64, 128, 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
build_model Not yet run
unverified (harvested, no recorded run)
yuanze-lin/Learnable_Regions/CLIP/clip_explainability/model.py
code served (permissive licence) · get_code("7ecaa1ab867d461d")
How it ran

no invocation recorded.

build_model Not yet run
unverified (harvested, no recorded run)
yuanze-lin/Learnable_Regions/CLIP/clip/model.py
code served (permissive licence) · get_code("ab2f38ac891c8d2e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 2 the same month, 5 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
drop_path 224 other papers
125 dated earlier, 6 the same month, 86 later, 6 same year, order not determinable, 1 undated · 38 only as an assembly brick
2003.12039 (2020-03)
RAFT: Recurrent All-Pairs Field Transforms for Optical Flow
2007.09384 (2020-07)
Multi-Scale Positive Sample Refinement for Few-Shot Object Detection
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
and 221 more not named here
build_model 119 other papers
44 dated earlier, 2 the same month, 68 later, 3 same year, order not determinable, 2 undated
1809.11096 (2018-09)
Large Scale GAN Training for High Fidelity Natural Image Synthesis
1901.07441 (2019-01)
PadChest: A large chest x-ray image dataset with multi-label annotated reports
2104.14294 (2021-04)
Emerging Properties in Self-Supervised Vision Transformers
and 116 more not named here
cosine_scheduler 37 other papers
23 dated earlier, 14 later
2005.10242 (2020-05)
Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
2103.15375 (2021-03)
AlignMixup: Improving Representations By Interpolating Aligned Features
2106.09681 (2021-06)
XCiT: Cross-Covariance Image Transformers
and 34 more not named here
bool_flag 31 other papers
18 dated earlier, 13 later
2106.09681 (2021-06)
XCiT: Cross-Covariance Image Transformers
2109.13228 (2021-09)
PASS: An ImageNet replacement for self-supervised pretraining without humans
2111.12958 (2021-11)
Self-Distilled Self-Supervised Representation Learning
and 28 more not named here
clip_gradients 28 other papers
16 dated earlier, 12 later
2106.09681 (2021-06)
XCiT: Cross-Covariance Image Transformers
2109.13228 (2021-09)
PASS: An ImageNet replacement for self-supervised pretraining without humans
2111.12958 (2021-11)
Self-Distilled Self-Supervised Representation Learning
and 25 more not named here
get_hyper 3 other papers
3 dated earlier
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
2302.05496 (2023-02)
MaskSketch: Unpaired Structure-guided Masked Image Generation
2306.04675 (2023-06)
Exposing flaws of generative model evaluation metrics and their unfair treatment of diffusion models
get_hyper 2 other papers
2 dated earlier
2302.05496 (2023-02)
MaskSketch: Unpaired Structure-guided Masked Image Generation
2306.04675 (2023-06)
Exposing flaws of generative model evaluation metrics and their unfair treatment of diffusion models

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

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

Abstract

Language has emerged as a natural interface for image editing. In this paper, we introduce a method for region-based image editing driven by textual prompts, without the need for user-provided masks or sketches. Specifically, our approach leverages an existing pre-trained text-to-image model and introduces a bounding box generator to identify the editing regions that are aligned with the textual prompts. We show that this simple approach enables flexible editing that is compatible with current image generation models, and is able to handle complex prompts featuring multiple objects, complex sentences, or lengthy paragraphs. We conduct an extensive user study to compare our method against state-of-the-art methods. The experiments demonstrate the competitive performance of our method in manipulating images with high fidelity and realism that correspond to the provided language descriptions. Our project webpage can be found at: https://yuanze-lin.me/LearnableRegions_page.

For agents

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

get_harvested_code_for_paper("2311.16432")
get_code_for_paper("2311.16432")
have("2311.16432")

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

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

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

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

Connect an agent — have() is free.