SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.13757 · 2020

Instance Semantic Segmentation Benefits from Generative Adversarial Networks

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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 3 have no contract verdict; 1 failure of our instrument; 0 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/2010.13757.json · badge: /api/ran/2010.13757.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
quangle2110/GAN_Mask-RCNN canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
FunctionStatusWhere it lives
expand_boxes Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
quangle2110/GAN_Mask-RCNN/maskrcnn-benchmark/maskrcnn_benchmark/modeling/roi_heads/mask_head/inference.py
pointer only (licence: MIT); the stored copy get_code serves, from tiankongzhang/nsa, is pointer only (licence: NONE) · get_code("5362c4106bc79217")
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 tiankongzhang/nsa, 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.

expand_masks Ran
ran on a synthesized input
quangle2110/GAN_Mask-RCNN/maskrcnn-benchmark/maskrcnn_benchmark/modeling/roi_heads/mask_head/inference.py
code served (permissive licence) · get_code("762ce037e4512c48")
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 torch

torch.manual_seed(0)

# Create a small mask tensor
# Shape: (batch_size=2, channels=1, height=4, width=4)
mask = torch.randint(0, 2, (2, 1, 4, 4), dtype=torch.float32)

# Define padding value
padding = 1

# Construct the arguments dictionary
ARGS = {
    "mask": mask,
    "padding": padding,
}
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 — 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
project_masks_on_boxes Ran
ran on a synthesized input
quangle2110/GAN_Mask-RCNN/gan_mrcnn.py
code served (permissive licence) · get_code("22c410487cf7934d")
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 (2, 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 numpy as np

torch.manual_seed(0)

class SegmentationMask:
    def __init__(self, mask_tensor, size):
        self.mask_tensor = mask_tensor
        self.size = size
    
    def crop(self, box):
        # box is [x1, y1, x2, y2]
        x1, y1, x2, y2 = [int(v) for v in box]
        x1, x2 = max(0, x1), min(self.mask_tensor.shape[1], x2)
        y1, y2 = max(0, y1), min(self.mask_tensor.shape[0], y2)
        if x2 <= x1 or y2 <= y1:
            cropped = torch.zeros((1, 1), dtype=torch.float32)
        else:
            cropped = self.mask_tensor[y1:y2, x1:x2]
        return SegmentationMask(cropped, (cropped.shape[0], cropped.shape[1]))
    
    def resize(self, size):
        M = size[0]
        resized = torch.nn.functional.interpolate(
            self.mask_tensor.unsqueeze(0).unsqueeze(0),
            size=(M, M),
            mode='bilinear',
            align_corners=False
        ).squeeze(0).squeeze(0)
        return SegmentationMask(resized, size)
    
    def get_mask_tensor(self):
        return self.mask_tensor

class SegmentationMasks:
    def __init__(self, masks, size):
        self.masks = masks
        self.size = size
    
    def __iter__(self):
        return iter(self.masks)
    
    def __len__(self):
        return len(self.masks)

class BoxList:
    def __init__(self, bbox, image_size):
        self.bbox = bbox
        self.image_size = image_size
        self.mode = 'xyxy'
    
    def convert(self, mode):
        # Already in xyxy format, return self
        return self
    
    @property
    def size(self):
        return self.image_size

# Create small test data
image_height, image_width = 16, 16
batch_size = 2

# Create segmentation masks
mask1 = torch.rand(16, 16, dtype=torch.float32)
mask2 = torch.rand(16, 16, dtype=torch.float32)
segmentation_masks = SegmentationMasks(
    [SegmentationMask(mask1, (16, 16)), SegmentationMask(mask2, (16, 16))],
    (image_height, image_width)
)

# Create proposals (bounding boxes in xyxy format)
proposals_bbox = torch.tensor([
    [2.0, 2.0, 8.0, 8.0],
    [4.0, 4.0, 12.0, 12.0]
], dtype=torch.float32)
proposals = BoxList(proposals_bbox, (image_height, image_width))

discretization_size = 4

ARGS = {
    'segmentation_masks': segmentation_masks,
    'proposals': proposals,
    'discretization_size': discretization_size
}
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 3, dtype family float, shape (2, 4, 4) — shape (2, 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
project_masks_on_boxes Ran
ran on a synthesized input
quangle2110/GAN_Mask-RCNN/maskrcnn-benchmark/maskrcnn_benchmark/modeling/roi_heads/mask_head/loss.py
code served (permissive licence) · get_code("7282d9e488dd0a6d")
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 (2, 16, 16) 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)

class MockSegmentationMask:
    def __init__(self, mask_tensor, size):
        self.mask_tensor = mask_tensor
        self.size = size
    
    def crop(self, box):
        # box is [x1, y1, x2, y2]
        # Return a cropped mask (simplified)
        cropped = self.mask_tensor.clone()
        return MockSegmentationMask(cropped, self.size)
    
    def resize(self, new_size):
        # Resize mask to new_size (H, W)
        resized = torch.nn.functional.interpolate(
            self.mask_tensor.unsqueeze(0).unsqueeze(0),
            size=new_size,
            mode='bilinear',
            align_corners=False
        ).squeeze(0).squeeze(0)
        return MockSegmentationMask(resized, new_size)
    
    def get_mask_tensor(self):
        return self.mask_tensor

class MockBoxList:
    def __init__(self, bboxes, image_size):
        self.bbox = bboxes
        self.size = image_size
        self._mode = 'xyxy'
    
    def convert(self, mode):
        # Return self since we'll keep it in xyxy
        self._mode = mode
        return self
    
    def __iter__(self):
        # Iterate over individual boxes
        for i in range(self.bbox.shape[0]):
            yield self.bbox[i]
    
    def __len__(self):
        return self.bbox.shape[0]

# Create segmentation masks
mask_tensor_1 = torch.rand(32, 32, dtype=torch.float32)
mask_tensor_2 = torch.rand(32, 32, dtype=torch.float32)
seg_mask_1 = MockSegmentationMask(mask_tensor_1, (64, 64))
seg_mask_2 = MockSegmentationMask(mask_tensor_2, (64, 64))

# Create a simple list-like container for segmentation masks
class SegmentationMaskList:
    def __init__(self, masks):
        self.masks = masks
        self.size = (64, 64)
    
    def __iter__(self):
        return iter(self.masks)
    
    def __len__(self):
        return len(self.masks)

segmentation_masks = SegmentationMaskList([seg_mask_1, seg_mask_2])

# Create bounding boxes (xyxy format): [x1, y1, x2, y2]
bboxes = torch.tensor([
    [10.0, 10.0, 30.0, 30.0],
    [15.0, 15.0, 45.0, 45.0]
], dtype=torch.float32)

proposals = MockBoxList(bboxes, (64, 64))

discretization_size = 16

ARGS = {
    'segmentation_masks': segmentation_masks,
    'proposals': proposals,
    'discretization_size': discretization_size
}
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 3, dtype family float, shape (2, 16, 16) — shape (2, 16, 16) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 0 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
expand_boxes 2 other papers
1 dated earlier, 1 later
1904.01355 (2019-04)
FCOS: Fully Convolutional One-Stage Object Detection
2308.08182 (2023-08)
Unsupervised Domain Adaptive Detection with Network Stability Analysis
expand_masks 1 other paper
1 dated earlier
1904.01355 (2019-04)
FCOS: Fully Convolutional One-Stage Object Detection
project_masks_on_boxes 1 other paper
1 dated earlier
1904.01355 (2019-04)
FCOS: Fully Convolutional One-Stage Object 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-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

In design of instance segmentation networks that reconstruct masks, segmentation is often taken as its literal definition -- assigning each pixel a label. This has led to thinking the problem as a template matching one with the goal of minimizing the loss between the reconstructed and the ground truth pixels. Rethinking reconstruction networks as a generator, we define the problem of predicting masks as a GANs game framework: A segmentation network generates the masks, and a discriminator network decides on the quality of the masks. To demonstrate this game, we show effective modifications on the general segmentation framework in Mask R-CNN. We find that playing the game in feature space is more effective than the pixel space leading to stable training between the discriminator and the generator, predicting object coordinates should be replaced by predicting contextual regions for objects, and overall the adversarial loss helps the performance and removes the need for any custom settings per different data domain. We test our framework in various domains and report on cellphone recycling, autonomous driving, large-scale object detection, and medical glands. We observe in general GANs yield masks that account for crispier boundaries, clutter, small objects, and details, being in domain of regular shapes or heterogeneous and coalescing shapes. Our code for reproducing the results is available publicly.

For agents

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

get_harvested_code_for_paper("2010.13757")
get_code_for_paper("2010.13757")
have("2010.13757")

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

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

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

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

Connect an agent — have() is free.