| AttentionRefinementModule |
Ran ran on a synthesized input |
zh320/realtime-semantic-segmentation-pytorch/models/stdc.py code served (permissive licence) · get_code("651a44aa15b71684") How it ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranThe 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |