anomalib.models.reverse_distillation.components.bottleneck¶
Torch model defining the bottleneck layer.
Module Contents¶
Classes¶
One-Class Bottleneck Embedding module. |
Functions¶
|
3x3 convolution with padding. |
|
1x1 convolution. |
|
Get appropriate bottleneck layer based on the name of the backbone. |
- anomalib.models.reverse_distillation.components.bottleneck.conv3x3(in_planes: int, out_planes: int, stride: int = 1, groups: int = 1, dilation: int = 1) torch.nn.Conv2d[source]¶
3x3 convolution with padding.
- anomalib.models.reverse_distillation.components.bottleneck.conv1x1(in_planes: int, out_planes: int, stride: int = 1) torch.nn.Conv2d[source]¶
1x1 convolution.
- class anomalib.models.reverse_distillation.components.bottleneck.OCBE(block: Type[Union[torchvision.models.resnet.Bottleneck, torchvision.models.resnet.BasicBlock]], layers: int, groups: int = 1, width_per_group: int = 64, norm_layer: Optional[Callable[Ellipsis, torch.nn.Module]] = None)[source]¶
Bases:
torch.nn.ModuleOne-Class Bottleneck Embedding module.
- Parameters
block (Bottleneck) – Expansion value is extracted from this block.
layers (int) – Numbers of OCE layers to create after multiscale feature fusion.
groups (int, optional) – Number of blocked connections from input channels to output channels. Defaults to 1.
width_per_group (int, optional) – Number of layers in each intermediate convolution layer. Defaults to 64.
norm_layer (Optional[Callable[..., nn.Module]], optional) – Batch norm layer to use. Defaults to None.
- anomalib.models.reverse_distillation.components.bottleneck.get_bottleneck_layer(backbone: str, **kwargs) OCBE[source]¶
Get appropriate bottleneck layer based on the name of the backbone.
- Parameters
backbone (str) – Name of the backbone.
- Returns
One-Class Bottleneck Embedding module.
- Return type
Bottleneck_layer