SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.13188 · CVPR · 2021

Rethinking BiSeNet For Real-time Semantic Segmentation

Mingyuan Fan, Meituan, Junfeng Luo, Xiaoming Wei, Junshi Huang, Zhenhua Chai, Shenqi Lai, Wei Xiaolin

arXiv · PDF · Open in the Atlas

Code that ran

9 of 16 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 8 have no contract verdict; 1 failure of our instrument; 7 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/2104.13188.json · badge: /api/ran/2104.13188.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
zh320/realtime-semantic-segmentation-pytorch community
Papers with Code archive
3 ran · 2 no recorded run
Deci-AI/super-gradients community
Papers with Code archive
2 ran · 3 no recorded run
MichaelFan01/STDC-Seg marked official in Papers with Code
Papers with Code archive
2 ran · 2 no recorded run
pideyi1025/DeepLabV3Plus-RailSem19 community (classifier label)
classifier basis not recorded on the link
2 ran · 0 no recorded run
FunctionStatusWhere it lives
AttentionRefinementModule Ran
ran on a synthesized input
zh320/realtime-semantic-segmentation-pytorch/models/stdc.py
code served (permissive licence) · get_code("651a44aa15b71684")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 8, 6) 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 as nn

# Define the classes from the problem
class Activation(nn.Module):

    def __init__(self, act_type, **kwargs):
        super().__init__()
        activation_hub = {'relu': nn.ReLU, 'relu6': nn.ReLU6, 'leakyrelu': nn.LeakyReLU, 'prelu': nn.PReLU, 'celu': nn.CELU, 'elu': nn.ELU, 'hardswish': nn.Hardswish, 'hardtanh': nn.Hardtanh, 'gelu': nn.GELU, 'glu': nn.GLU, 'selu': nn.SELU, 'silu': nn.SiLU, 'sigmoid': nn.Sigmoid, 'softmax': nn.Softmax, 'tanh': nn.Tanh, 'none': nn.Identity}
        act_type = act_type.lower()
        if act_type not in activation_hub.keys():
            raise NotImplementedError(f'Unsupport activation type: {act_type}')
        self.activation = activation_hub[act_type](**kwargs)

    def forward(self, x):
        return self.activation(x)

class ConvBNAct(nn.Sequential):

    def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, dilation=1, groups=1, bias=False, act_type='relu', **kwargs):
        if isinstance(kernel_size, list) or isinstance(kernel_size, tuple):
            padding = ((kernel_size[0] - 1) // 2 * dilation, (kernel_size[1] - 1) // 2 * dilation)
        elif isinstance(kernel_size, int):
            padding = (kernel_size - 1) // 2 * dilation
        super().__init__(nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias), nn.BatchNorm2d(out_channels), Activation(act_type, **kwargs))

class AttentionRefinementModule(nn.Module):

    def __init__(self, channels):
        super().__init__()
        self.pool = nn.AdaptiveAvgPool2d(1)
        self.conv = ConvBNAct(channels, channels, 1, act_type='sigmoid')

    def forward(self, x):
        x_pool = self.pool(x)
        x_pool = x_pool.expand_as(x)
        x_pool = self.conv(x_pool)
        x = x * x_pool
        return x

# Setup code
INIT_ARGS = {
    'channels': 4
}

ARGS = {
    'x': torch.randn(2, 4, 8, 6)
}

# Construct and call
module = AttentionRefinementModule(**INIT_ARGS)
module.eval()
output = module(**ARGS)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 4, 8, 6) — shape (2, 4, 8, 6) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
CatBottleneck Ran
ran on a synthesized input
MichaelFan01/STDC-Seg/nets/stdcnet.py
code served (permissive licence) · get_code("97c83f5a9b50d09c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, 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
import math

class ConvX(nn.Module):

    def __init__(self, in_planes, out_planes, kernel=3, stride=1):
        super(ConvX, self).__init__()
        self.conv = nn.Conv2d(in_planes, out_planes, kernel_size=kernel, stride=stride, padding=kernel // 2, bias=False)
        self.bn = nn.BatchNorm2d(out_planes)
        self.relu = nn.ReLU(inplace=True)

    def forward(self, x):
        out = self.relu(self.bn(self.conv(x)))
        return out

class CatBottleneck(nn.Module):

    def __init__(self, in_planes, out_planes, block_num=3, stride=1):
        super(CatBottleneck, self).__init__()
        assert block_num > 1, print('block number should be larger than 1.')
        self.conv_list = nn.ModuleList()
        self.stride = stride
        if stride == 2:
            self.avd_layer = nn.Sequential(nn.Conv2d(out_planes // 2, out_planes // 2, kernel_size=3, stride=2, padding=1, groups=out_planes // 2, bias=False), nn.BatchNorm2d(out_planes // 2))
            self.skip = nn.AvgPool2d(kernel_size=3, stride=2, padding=1)
            stride = 1
        for idx in range(block_num):
            if idx == 0:
                self.conv_list.append(ConvX(in_planes, out_planes // 2, kernel=1))
            elif idx == 1 and block_num == 2:
                self.conv_list.append(ConvX(out_planes // 2, out_planes // 2, stride=stride))
            elif idx == 1 and block_num > 2:
                self.conv_list.append(ConvX(out_planes // 2, out_planes // 4, stride=stride))
            elif idx < block_num - 1:
                self.conv_list.append(ConvX(out_planes // int(math.pow(2, idx)), out_planes // int(math.pow(2, idx + 1))))
            else:
                self.conv_list.append(ConvX(out_planes // int(math.pow(2, idx)), out_planes // int(math.pow(2, idx))))

    def forward(self, x):
        out_list = []
        out1 = self.conv_list[0](x)
        for idx, conv in enumerate(self.conv_list[1:]):
            if idx == 0:
                if self.stride == 2:
                    out = conv(self.avd_layer(out1))
                else:
                    out = conv(out1)
            else:
                out = conv(out)
            out_list.append(out)
        if self.stride == 2:
            out1 = self.skip(out1)
        out_list.insert(0, out1)
        out = torch.cat(out_list, dim=1)
        return out

INIT_ARGS = {
    'in_planes': 6,
    'out_planes': 16,
    'block_num': 3,
    'stride': 1
}

ARGS = {
    'x': torch.randn(2, 6, 8, 8)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ConvBNAct Ran
ran on a synthesized input
Deci-AI/super-gradients/src/super_gradients/training/models/segmentation_models/stdc.py
code served (permissive licence) · get_code("0a4552c5e0d129a9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, 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
from typing import Union, Tuple, Type, Callable, Optional
from abc import ABC, abstractmethod

class SupportsReplaceInputChannels(ABC):
    """
    Protocol interface for modules that support replacing the number of input channels.
    Derived classes should implement the `replace_input_channels` method.

    This interface class serves the purpose of explicitly indicating whether a class supports optimized input channel replacement:

    >>> class InputLayer(nn_Module, SupportsReplaceInputChannels):
    >>>    def replace_input_channels(self, in_channels: int, compute_new_weights_fn: Callable[[nn.Module, int], nn.Module] = None):
    >>>       ...

    """

    def replace_input_channels(self, in_channels: int, compute_new_weights_fn: Optional[Callable[[nn.Module, int], nn.Module]]):
        """
        Replace the number of input channels in the module.

        :param in_channels:             New number of input channels.
        :param compute_new_weights_fn:  (Optional) function that computes the new weights for the new input channels.
                                        It takes the existing nn_Module and returns a new one.
        """
        raise NotImplementedError(f'`replace_input_channels` is not implemented in the derived class `{self.__class__.__name__}`')

    def get_input_channels(self) -> int:
        """Get the number of input channels for the model.

        :return: Number of input channels.
        """
        raise NotImplementedError(f'`get_input_channels` is not implemented in the derived class `{self.__class__.__name__}`')

class ConvBNAct(nn.Module, SupportsReplaceInputChannels):
    """
    Class for Convolution2d-Batchnorm2d-Activation layer.
        Default behaviour is Conv-BN-Act. To exclude Batchnorm module use
        `use_normalization=False`, to exclude activation use `activation_type=None`.
    For convolution arguments documentation see `nn.Conv2d`.
    For batchnorm arguments documentation see `nn.BatchNorm2d`.
    """

    def __init__(self, in_channels: int, out_channels: int, kernel_size: Union[int, Tuple[int, int]], padding: Union[int, Tuple[int, int]], activation_type: Type[nn.Module], stride: Union[int, Tuple[int, int]]=1, dilation: Union[int, Tuple[int, int]]=1, groups: int=1, bias: bool=True, padding_mode: str='zeros', use_normalization: bool=True, eps: float=1e-05, momentum: float=0.1, affine: bool=True, track_running_stats: bool=True, device=None, dtype=None, activation_kwargs=None):
        super().__init__()
        if activation_kwargs is None:
            activation_kwargs = {}
        self.seq = nn.Sequential()
        self.seq.add_module('conv', nn.Conv2d(in_channels, out_channels, kernel_size=kernel_size, stride=stride, padding=padding, dilation=dilation, groups=groups, bias=bias, padding_mode=padding_mode))
        if use_normalization:
            self.seq.add_module('bn', nn.BatchNorm2d(out_channels, eps=eps, momentum=momentum, affine=affine, track_running_stats=track_running_stats, device=device, dtype=dtype))
        if activation_type is not None:
            self.seq.add_module('act', activation_type(**activation_kwargs))

    def forward(self, x):
        return self.seq(x)

    def replace_input_channels(self, in_channels: int, compute_new_weights_fn: Optional[Callable[[nn.Module, int], nn.Module]]=None):
        # Simplified implementation without external dependency
        old_conv = self.seq[0]
        new_conv = nn.Conv2d(
            in_channels=in_channels,
            out_channels=old_conv.out_channels,
            kernel_size=old_conv.kernel_size,
            stride=old_conv.stride,
            padding=old_conv.padding,
            dilation=old_conv.dilation,
            groups=old_conv.groups,
            bias=old_conv.bias is not None,
            padding_mode=old_conv.padding_mode
        )
        self.seq[0] = new_conv

    def get_input_channels(self) -> int:
        return self.seq[0].in_channels


INIT_ARGS = {
    'in_channels': 3,
    'out_channels': 16,
    'kernel_size': 3,
    'padding': 1,
    'activation_type': nn.ReLU,
    'stride': 1,
    'dilation': 1,
    'groups': 1,
    'bias': True,
    'padding_mode': 'zeros',
    'use_normalization': True,
    'eps': 1e-05,
    'momentum': 0.1,
    'affine': True,
    'track_running_stats': True,
    'device': None,
    'dtype': None,
    'activation_kwargs': None
}

ARGS = {
    'x': torch.randn(2, 3, 8, 8)
}

if __name__ == '__main__':
    model = ConvBNAct(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Input channels: {model.get_input_channels()}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
super_gradients, 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ConvX Ran
ran on a synthesized input
MichaelFan01/STDC-Seg/nets/stdcnet.py
code served (permissive licence) · get_code("bd9e2f16a5c9b881")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 8, 8) 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 as nn

class ConvX(nn.Module):

    def __init__(self, in_planes, out_planes, kernel=3, stride=1):
        super(ConvX, self).__init__()
        self.conv = nn.Conv2d(in_planes, out_planes, kernel_size=kernel, stride=stride, padding=kernel // 2, bias=False)
        self.bn = nn.BatchNorm2d(out_planes)
        self.relu = nn.ReLU(inplace=True)

    def forward(self, x):
        out = self.relu(self.bn(self.conv(x)))
        return out


INIT_ARGS = {
    'in_planes': 3,
    'out_planes': 4,
    'kernel': 3,
    'stride': 1,
}

ARGS = {
    'x': torch.randn(2, 3, 8, 8),
}

if __name__ == '__main__':
    model = ConvX(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: torch.Size([2, 4, 8, 8])")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 4, 8, 8) — shape (2, 4, 8, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
FeatureFusionModule Ran
ran on a synthesized input
zh320/realtime-semantic-segmentation-pytorch/models/stdc.py
code served (permissive licence) · get_code("8ccfe4aa060066bc")
How it ran

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

import torch
import torch.nn as nn

# First, define the classes from the provided code
class Activation(nn.Module):

    def __init__(self, act_type, **kwargs):
        super().__init__()
        activation_hub = {'relu': nn.ReLU, 'relu6': nn.ReLU6, 'leakyrelu': nn.LeakyReLU, 'prelu': nn.PReLU, 'celu': nn.CELU, 'elu': nn.ELU, 'hardswish': nn.Hardswish, 'hardtanh': nn.Hardtanh, 'gelu': nn.GELU, 'glu': nn.GLU, 'selu': nn.SELU, 'silu': nn.SiLU, 'sigmoid': nn.Sigmoid, 'softmax': nn.Softmax, 'tanh': nn.Tanh, 'none': nn.Identity}
        act_type = act_type.lower()
        if act_type not in activation_hub.keys():
            raise NotImplementedError(f'Unsupport activation type: {act_type}')
        self.activation = activation_hub[act_type](**kwargs)

    def forward(self, x):
        return self.activation(x)

class ConvBNAct(nn.Sequential):

    def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, dilation=1, groups=1, bias=False, act_type='relu', **kwargs):
        if isinstance(kernel_size, list) or isinstance(kernel_size, tuple):
            padding = ((kernel_size[0] - 1) // 2 * dilation, (kernel_size[1] - 1) // 2 * dilation)
        elif isinstance(kernel_size, int):
            padding = (kernel_size - 1) // 2 * dilation
        super().__init__(nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias), nn.BatchNorm2d(out_channels), Activation(act_type, **kwargs))

def conv1x1(in_channels, out_channels, stride=1, bias=False):
    return nn.Conv2d(in_channels, out_channels, kernel_size=1, stride=stride, padding=0, bias=bias)

class FeatureFusionModule(nn.Module):

    def __init__(self, in_channels, out_channels, act_type):
        super().__init__()
        self.conv1 = ConvBNAct(in_channels, out_channels, 3, act_type=act_type)
        self.pool = nn.AdaptiveAvgPool2d(1)
        self.conv2 = nn.Sequential(conv1x1(out_channels, out_channels), nn.ReLU(), conv1x1(out_channels, out_channels), nn.Sigmoid())

    def forward(self, x_low, x_high):
        x = torch.cat([x_low, x_high], dim=1)
        x = self.conv1(x)
        x_pool = self.pool(x)
        x_pool = x_pool.expand_as(x)
        x_pool = self.conv2(x_pool)
        x_pool = x * x_pool
        x = x + x_pool
        return x

# Define initialization arguments
INIT_ARGS = {
    'in_channels': 8,
    'out_channels': 4,
    'act_type': 'relu'
}

# Define forward pass arguments
# x_low and x_high should have matching spatial dimensions but can have different channel counts
# that sum to in_channels (8)
ARGS = {
    'x_low': torch.randn(2, 4, 3, 3),
    'x_high': torch.randn(2, 4, 3, 3)
}

# Construct and call the module
module = FeatureFusionModule(**INIT_ARGS)
output = module(**ARGS)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 4, 3, 3) — shape (2, 4, 3, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Residual Ran
ran on a synthesized input
Deci-AI/super-gradients/src/super_gradients/training/models/segmentation_models/stdc.py
code served (permissive licence) · get_code("9593929516a67196")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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 torch.nn as nn

class Residual(nn.Module):
    """
    This is a placeholder module used by the quantization engine only.
    This module will be replaced by converters.
    The module is to be used as a residual skip connection within a single block.
    """

    def forward(self, x):
        return x


INIT_ARGS = {}

ARGS = {
    'x': torch.randn(2, 4)
}

if __name__ == '__main__':
    model = Residual(**INIT_ARGS)
    output = model(**ARGS)
    print(output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
STDCModule Ran
ran on a synthesized input
zh320/realtime-semantic-segmentation-pytorch/models/stdc.py
code served (permissive licence) · get_code("a6375542a388edf0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 16, 8, 8) 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 as nn

class Activation(nn.Module):

    def __init__(self, act_type, **kwargs):
        super().__init__()
        activation_hub = {'relu': nn.ReLU, 'relu6': nn.ReLU6, 'leakyrelu': nn.LeakyReLU, 'prelu': nn.PReLU, 'celu': nn.CELU, 'elu': nn.ELU, 'hardswish': nn.Hardswish, 'hardtanh': nn.Hardtanh, 'gelu': nn.GELU, 'glu': nn.GLU, 'selu': nn.SELU, 'silu': nn.SiLU, 'sigmoid': nn.Sigmoid, 'softmax': nn.Softmax, 'tanh': nn.Tanh, 'none': nn.Identity}
        act_type = act_type.lower()
        if act_type not in activation_hub.keys():
            raise NotImplementedError(f'Unsupport activation type: {act_type}')
        self.activation = activation_hub[act_type](**kwargs)

    def forward(self, x):
        return self.activation(x)

class ConvBNAct(nn.Sequential):

    def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, dilation=1, groups=1, bias=False, act_type='relu', **kwargs):
        if isinstance(kernel_size, list) or isinstance(kernel_size, tuple):
            padding = ((kernel_size[0] - 1) // 2 * dilation, (kernel_size[1] - 1) // 2 * dilation)
        elif isinstance(kernel_size, int):
            padding = (kernel_size - 1) // 2 * dilation
        super().__init__(nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias), nn.BatchNorm2d(out_channels), Activation(act_type, **kwargs))

class STDCModule(nn.Module):

    def __init__(self, in_channels, out_channels, stride, act_type):
        super().__init__()
        if out_channels % 8 != 0:
            raise ValueError('Output channel should be evenly divided by 8.\n')
        if stride not in [1, 2]:
            raise ValueError(f'Unsupported stride: {stride}\n')
        self.stride = stride
        self.block1 = ConvBNAct(in_channels, out_channels // 2, 1)
        self.block2 = ConvBNAct(out_channels // 2, out_channels // 4, 3, stride)
        if self.stride == 2:
            self.pool = nn.AvgPool2d(3, 2, 1)
        self.block3 = ConvBNAct(out_channels // 4, out_channels // 8, 3)
        self.block4 = ConvBNAct(out_channels // 8, out_channels // 8, 3)

    def forward(self, x):
        x1 = self.block1(x)
        x2 = self.block2(x1)
        if self.stride == 2:
            x1 = self.pool(x1)
        x3 = self.block3(x2)
        x4 = self.block4(x3)
        return torch.cat([x1, x2, x3, x4], dim=1)


INIT_ARGS = {
    'in_channels': 3,
    'out_channels': 16,
    'stride': 1,
    'act_type': 'relu'
}

ARGS = {
    'x': torch.randn(2, 3, 8, 8)
}

if __name__ == '__main__':
    module = STDCModule(**INIT_ARGS)
    output = module(**ARGS)
    print(f"Output shape: {output.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 16, 8, 8) — shape (2, 16, 8, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
get_preprocessing Ran
ran on a synthesized input
pideyi1025/DeepLabV3Plus-RailSem19/evaluate.py
code served (permissive licence) · get_code("30208284736b9b4e")
How it ran

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

import numpy as np
import albumentations as album

def to_tensor(x, **kwargs):
    return x.transpose(2, 0, 1).astype('float32')

# Define a simple preprocessing function
def simple_preprocessing_fn(image, **kwargs):
    """Simple normalization function"""
    return image / 255.0

ARGS = {
    "preprocessing_fn": simple_preprocessing_fn
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
albumentations, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
to_tensor Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
pideyi1025/DeepLabV3Plus-RailSem19/evaluate.py
pointer only (licence: MIT); the stored copy get_code serves, from analytics-everywhere-lab/vqixai, is pointer only (licence: NONE) · get_code("233ef2824a5baa1a")
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 analytics-everywhere-lab/vqixai, 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.

AddBottleneck Not yet run
unverified (harvested, no recorded run)
MichaelFan01/STDC-Seg/nets/stdcnet.py
code served (permissive licence) · get_code("e352a650699c3703")
How it ran

no invocation recorded.

ConvBNReLU Not yet run
unverified (harvested, no recorded run)
Deci-AI/super-gradients/src/super_gradients/training/models/segmentation_models/stdc.py
code served (permissive licence) · get_code("8942f44b7273d2b1")
How it ran

no invocation recorded.

STDC Not yet run
unverified (harvested, no recorded run)
zh320/realtime-semantic-segmentation-pytorch/models/stdc.py
code served (permissive licence) · get_code("09fe1398d60fd154")
How it ran

no invocation recorded.

STDCBlock Not yet run
unverified (harvested, no recorded run)
Deci-AI/super-gradients/src/super_gradients/training/models/segmentation_models/stdc.py
code served (permissive licence) · get_code("be030794ada81ba9")
How it ran

no invocation recorded.

STDCNet1446 Not yet run
unverified (harvested, no recorded run)
MichaelFan01/STDC-Seg/nets/stdcnet.py
code served (permissive licence) · get_code("6d18c795468569a2")
How it ran

no invocation recorded.

SegHead Not yet run
unverified (harvested, no recorded run)
zh320/realtime-semantic-segmentation-pytorch/models/stdc.py
code served (permissive licence) · get_code("548ed9ee6767dd7a")
How it ran

no invocation recorded.

SupportsReplaceInputChannels Not yet run
unverified (harvested, no recorded run)
Deci-AI/super-gradients/src/super_gradients/training/models/segmentation_models/stdc.py
code served (permissive licence) · get_code("9669048dacdf270a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 13 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
Residual
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
SupportsReplaceInputChannels
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1704.04861 (2017-04)
MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications
to_tensor 1 other paper
1 later
2407.11771 (2024-07)
XEdgeAI: A Human-centered Industrial Inspection Framework with Data-centric Explainable Edge AI Approach

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

BiSeNet [28,27] has been proved to be a popular twostream network for real-time segmentation. However, its principle of adding an extra path to encode spatial information is time-consuming, and the backbones borrowed from pretrained tasks, e.g., image classification, may be inefficient for image segmentation due to the deficiency of taskspecific design. To handle these problems, we propose a novel and efficient structure named Short-Term Dense Concatenate network (STDC network) by removing structure redundancy. Specifically, we gradually reduce the dimension of feature maps and use the aggregation of them for image representation, which forms the basic module of STDC network. In the decoder, we propose a Detail Aggregation module by integrating the learning of spatial information into low-level layers in single-stream manner. Finally, the low-level features and deep features are fused to predict the final segmentation results. Extensive experiments on Cityscapes and CamVid dataset demonstrate the effectiveness of our method by achieving promising trade-off between segmentation accuracy and inference speed. On Cityscapes, we achieve 71.9% mIoU on the test set with a speed of 250.4 FPS on NVIDIA GTX 1080Ti, which is 45.2% faster than the latest methods, and achieve 76.8% mIoU with 97.0 FPS while inferring on higher resolution images. Code is available at https://github.com/ MichaelFan01/STDC-Seg.

For agents

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

get_harvested_code_for_paper("2104.13188")
get_code_for_paper("2104.13188")
have("2104.13188")

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

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

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

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

Connect an agent — have() is free.