torchvision
Module diagram
classDiagram
class torchvision {
}
class regnet {
}
class resnet {
}
class squeezenet {
}
class vgg {
}
model.backbone.torchvision
regnet
__all__
module-attribute
__all__ = ['RegNet', 'regnet_y_400mf', 'regnet_y_800mf', 'regnet_y_1_6gf', 'regnet_y_3_2gf', 'regnet_y_8gf', 'regnet_y_16gf', 'regnet_y_32gf', 'regnet_y_128gf', 'regnet_x_400mf', 'regnet_x_800mf', 'regnet_x_1_6gf', 'regnet_x_3_2gf', 'regnet_x_8gf', 'regnet_x_16gf', 'regnet_x_32gf']
SimpleStemIN
SimpleStemIN(width_in: int, width_out: int, norm_layer: Callable[..., Module], activation_layer: Callable[..., Module])
Bases: Conv2dNormActivation
Simple stem for ImageNet: 3x3, BN, ReLU.
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
BottleneckTransform
BottleneckTransform(width_in: int, width_out: int, stride: int, norm_layer: Callable[..., Module], activation_layer: Callable[..., Module], group_width: int, bottleneck_multiplier: float, se_ratio: Optional[float])
Bases: Sequential
Bottleneck transformation: 1x1, 3x3 [+SE], 1x1.
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
ResBottleneckBlock
ResBottleneckBlock(width_in: int, width_out: int, stride: int, norm_layer: Callable[..., Module], activation_layer: Callable[..., Module], group_width: int = 1, bottleneck_multiplier: float = 1.0, se_ratio: Optional[float] = None)
Bases: Module
Residual bottleneck block: x + F(x), F = bottleneck transform.
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
f
instance-attribute
f = BottleneckTransform(width_in, width_out, stride, norm_layer, activation_layer, group_width, bottleneck_multiplier, se_ratio)
AnyStage
AnyStage(width_in: int, width_out: int, stride: int, depth: int, block_constructor: Callable[..., Module], norm_layer: Callable[..., Module], activation_layer: Callable[..., Module], group_width: int, bottleneck_multiplier: float, se_ratio: Optional[float] = None, stage_index: int = 0)
Bases: Sequential
AnyNet stage (sequence of blocks w/ the same output shape).
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
BlockParams
BlockParams(depths: List[int], widths: List[int], group_widths: List[int], bottleneck_multipliers: List[float], strides: List[int], se_ratio: Optional[float] = None)
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
from_init_params
classmethod
from_init_params(depth: int, w_0: int, w_a: float, w_m: float, group_width: int, bottleneck_multiplier: float = 1.0, se_ratio: Optional[float] = None, **kwargs: Any) -> BlockParams
Programmatically compute all the per-block settings,
given the RegNet parameters.
The first step is to compute the quantized linear block parameters,
in log space. Key parameters are:
- w_a is the width progression slope
- w_0 is the initial width
- w_m is the width stepping in the log space
In other terms
log(block_width) = log(w_0) + w_m * block_capacity,
with bock_capacity ramping up following the w_0 and w_a params.
This block width is finally quantized to multiples of 8.
The second step is to compute the parameters per stage,
taking into account the skip connection and the final 1x1 convolutions.
We use the fact that the output width is constant within a stage.
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
_get_expanded_params
_adjust_widths_groups_compatibilty
staticmethod
_adjust_widths_groups_compatibilty(stage_widths: List[int], bottleneck_ratios: List[float], group_widths: List[int]) -> Tuple[List[int], List[int]]
Adjusts the compatibility of widths and groups, depending on the bottleneck ratio.
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
RegNet
RegNet(block_params: BlockParams, num_classes: int = 1000, stem_width: int = 32, stem_type: Optional[Callable[..., Module]] = None, block_type: Optional[Callable[..., Module]] = None, norm_layer: Optional[Callable[..., Module]] = None, activation: Optional[Callable[..., Module]] = None, in_channels: int = 3)
Bases: Module
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 | |
forward
load_state_dict
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
_regnet
_regnet(block_params: BlockParams, weights: Optional[WeightsEnum], progress: bool, **kwargs: Any) -> RegNet
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_y_400mf
regnet_y_400mf(*, weights: Optional[RegNet_Y_400MF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetY_400MF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_Y_400MF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_Y_400MF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_Y_400MF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_y_800mf
regnet_y_800mf(*, weights: Optional[RegNet_Y_800MF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetY_800MF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_Y_800MF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_Y_800MF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_Y_800MF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_y_1_6gf
regnet_y_1_6gf(*, weights: Optional[RegNet_Y_1_6GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetY_1.6GF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_Y_1_6GF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_Y_1_6GF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_Y_1_6GF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_y_3_2gf
regnet_y_3_2gf(*, weights: Optional[RegNet_Y_3_2GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetY_3.2GF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_Y_3_2GF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_Y_3_2GF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_Y_3_2GF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_y_8gf
regnet_y_8gf(*, weights: Optional[RegNet_Y_8GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetY_8GF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_Y_8GF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_Y_8GF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_Y_8GF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_y_16gf
regnet_y_16gf(*, weights: Optional[RegNet_Y_16GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetY_16GF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_Y_16GF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_Y_16GF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_Y_16GF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_y_32gf
regnet_y_32gf(*, weights: Optional[RegNet_Y_32GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetY_32GF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_Y_32GF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_Y_32GF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_Y_32GF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_y_128gf
regnet_y_128gf(*, weights: Optional[RegNet_Y_128GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetY_128GF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_Y_128GF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_Y_128GF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_Y_128GF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_x_400mf
regnet_x_400mf(*, weights: Optional[RegNet_X_400MF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetX_400MF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_X_400MF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_X_400MF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_X_400MF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_x_800mf
regnet_x_800mf(*, weights: Optional[RegNet_X_800MF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetX_800MF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_X_800MF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_X_800MF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_X_800MF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_x_1_6gf
regnet_x_1_6gf(*, weights: Optional[RegNet_X_1_6GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetX_1.6GF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_X_1_6GF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_X_1_6GF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_X_1_6GF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_x_3_2gf
regnet_x_3_2gf(*, weights: Optional[RegNet_X_3_2GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetX_3.2GF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_X_3_2GF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_X_3_2GF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_X_3_2GF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_x_8gf
regnet_x_8gf(*, weights: Optional[RegNet_X_8GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetX_8GF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_X_8GF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_X_8GF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_X_8GF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_x_16gf
regnet_x_16gf(*, weights: Optional[RegNet_X_16GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetX_16GF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_X_16GF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_X_16GF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_X_16GF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
regnet_x_32gf
regnet_x_32gf(*, weights: Optional[RegNet_X_32GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet
Constructs a RegNetX_32GF architecture from
Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>.
Args:
weights (:class:~torchvision.models.RegNet_X_32GF_Weights, optional): The pretrained weights to use.
See :class:~torchvision.models.RegNet_X_32GF_Weights below for more details and possible values.
By default, no pretrained weights are used.
progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to either torchvision.models.regnet.RegNet or
torchvision.models.regnet.BlockParams class. Please refer to the source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>
for more detail about the classes.
.. autoclass:: torchvision.models.RegNet_X_32GF_Weights
:members:
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
resnet
__all__
module-attribute
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152', 'resnext50_32x4d', 'resnext101_32x8d', 'resnext101_64x4d', 'wide_resnet50_2', 'wide_resnet101_2']
BasicBlock
BasicBlock(inplanes: int, planes: int, stride: int = 1, downsample: Optional[Module] = None, groups: int = 1, base_width: int = 64, dilation: int = 1, norm_layer: Optional[Callable[..., Module]] = None)
Bases: Module
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
forward
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
Bottleneck
Bottleneck(inplanes: int, planes: int, stride: int = 1, downsample: Optional[Module] = None, groups: int = 1, base_width: int = 64, dilation: int = 1, norm_layer: Optional[Callable[..., Module]] = None)
Bases: Module
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
forward
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
ResNet
ResNet(block: Type[Union[BasicBlock, Bottleneck]], layers: List[int], num_classes: int = 1000, zero_init_residual: bool = False, groups: int = 1, width_per_group: int = 64, replace_stride_with_dilation: Optional[List[bool]] = None, norm_layer: Optional[Callable[..., Module]] = None, in_channels: int = 3)
Bases: Module
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
conv1
instance-attribute
layer2
instance-attribute
layer3
instance-attribute
layer4
instance-attribute
_make_layer
_make_layer(block: Type[Union[BasicBlock, Bottleneck]], planes: int, blocks: int, stride: int = 1, dilate: bool = False) -> Sequential
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
_forward_impl
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
forward
load_state_dict
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
conv3x3
conv3x3(in_planes: int, out_planes: int, stride: int = 1, groups: int = 1, dilation: int = 1) -> Conv2d
3x3 convolution with padding
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
conv1x1
_resnet
_resnet(block: Type[Union[BasicBlock, Bottleneck]], layers: List[int], weights: Optional[WeightsEnum], progress: bool, **kwargs: Any) -> ResNet
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
resnet18
resnet18(*, weights: Optional[ResNet18_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet
ResNet-18 from Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>__.
Parameters:
-
weights (–class:
~torchvision.models.ResNet18_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNet18_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.resnet.ResNetbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.
.. autoclass:: torchvision.models.ResNet18_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
resnet34
resnet34(*, weights: Optional[ResNet34_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet
ResNet-34 from Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>__.
Parameters:
-
weights (–class:
~torchvision.models.ResNet34_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNet34_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.resnet.ResNetbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.
.. autoclass:: torchvision.models.ResNet34_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
resnet50
resnet50(*, weights: Optional[ResNet50_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet
ResNet-50 from Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>__.
.. note::
The bottleneck of TorchVision places the stride for downsampling to the second 3x3
convolution while the original paper places it to the first 1x1 convolution.
This variant improves the accuracy and is known as ResNet V1.5
<https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>_.
Parameters:
-
weights (–class:
~torchvision.models.ResNet50_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNet50_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.resnet.ResNetbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.
.. autoclass:: torchvision.models.ResNet50_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
resnet101
resnet101(*, weights: Optional[ResNet101_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet
ResNet-101 from Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>__.
.. note::
The bottleneck of TorchVision places the stride for downsampling to the second 3x3
convolution while the original paper places it to the first 1x1 convolution.
This variant improves the accuracy and is known as ResNet V1.5
<https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>_.
Parameters:
-
weights (–class:
~torchvision.models.ResNet101_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNet101_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.resnet.ResNetbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.
.. autoclass:: torchvision.models.ResNet101_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
resnet152
resnet152(*, weights: Optional[ResNet152_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet
ResNet-152 from Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>__.
.. note::
The bottleneck of TorchVision places the stride for downsampling to the second 3x3
convolution while the original paper places it to the first 1x1 convolution.
This variant improves the accuracy and is known as ResNet V1.5
<https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>_.
Parameters:
-
weights (–class:
~torchvision.models.ResNet152_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNet152_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.resnet.ResNetbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.
.. autoclass:: torchvision.models.ResNet152_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
resnext50_32x4d
resnext50_32x4d(*, weights: Optional[ResNeXt50_32X4D_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet
ResNeXt-50 32x4d model from
Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>_.
Parameters:
-
weights (–class:
~torchvision.models.ResNeXt50_32X4D_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNext50_32X4D_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.resnet.ResNetbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.
.. autoclass:: torchvision.models.ResNeXt50_32X4D_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
resnext101_32x8d
resnext101_32x8d(*, weights: Optional[ResNeXt101_32X8D_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet
ResNeXt-101 32x8d model from
Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>_.
Parameters:
-
weights (–class:
~torchvision.models.ResNeXt101_32X8D_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNeXt101_32X8D_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.resnet.ResNetbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.
.. autoclass:: torchvision.models.ResNeXt101_32X8D_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
resnext101_64x4d
resnext101_64x4d(*, weights: Optional[ResNeXt101_64X4D_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet
ResNeXt-101 64x4d model from
Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>_.
Parameters:
-
weights (–class:
~torchvision.models.ResNeXt101_64X4D_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.ResNeXt101_64X4D_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.resnet.ResNetbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.
.. autoclass:: torchvision.models.ResNeXt101_64X4D_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
wide_resnet50_2
wide_resnet50_2(*, weights: Optional[Wide_ResNet50_2_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet
Wide ResNet-50-2 model from
Wide Residual Networks <https://arxiv.org/abs/1605.07146>_.
The model is the same as ResNet except for the bottleneck number of channels which is twice larger in every block. The number of channels in outer 1x1 convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048 channels, and in Wide ResNet-50-2 has 2048-1024-2048.
Parameters:
-
weights (–class:
~torchvision.models.Wide_ResNet50_2_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.Wide_ResNet50_2_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.resnet.ResNetbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.
.. autoclass:: torchvision.models.Wide_ResNet50_2_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
wide_resnet101_2
wide_resnet101_2(*, weights: Optional[Wide_ResNet101_2_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet
Wide ResNet-101-2 model from
Wide Residual Networks <https://arxiv.org/abs/1605.07146>_.
The model is the same as ResNet except for the bottleneck number of channels which is twice larger in every block. The number of channels in outer 1x1 convolutions is the same, e.g. last block in ResNet-101 has 2048-512-2048 channels, and in Wide ResNet-101-2 has 2048-1024-2048.
Parameters:
-
weights (–class:
~torchvision.models.Wide_ResNet101_2_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.Wide_ResNet101_2_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.resnet.ResNetbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>_ for more details about this class.
.. autoclass:: torchvision.models.Wide_ResNet101_2_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/resnet.py
squeezenet
Fire
Bases: Module
Source code in SaigeToolkit/model/backbone/torchvision/squeezenet.py
expand3x3
instance-attribute
forward
SqueezeNet
SqueezeNet(version: str = '1_0', num_classes: int = 1000, dropout: float = 0.5, in_channels: int = 3)
Bases: Module
Source code in SaigeToolkit/model/backbone/torchvision/squeezenet.py
features
instance-attribute
features = Sequential(Conv2d(in_channels, 96, kernel_size=7, stride=2), ReLU(inplace=True), MaxPool2d(kernel_size=3, stride=2, ceil_mode=True), Fire(96, 16, 64, 64), Fire(128, 16, 64, 64), Fire(128, 32, 128, 128), MaxPool2d(kernel_size=3, stride=2, ceil_mode=True), Fire(256, 32, 128, 128), Fire(256, 48, 192, 192), Fire(384, 48, 192, 192), Fire(384, 64, 256, 256), MaxPool2d(kernel_size=3, stride=2, ceil_mode=True), Fire(512, 64, 256, 256))
forward
load_state_dict
Source code in SaigeToolkit/model/backbone/torchvision/squeezenet.py
_squeezenet
_squeezenet(version: str, weights: Optional[WeightsEnum], progress: bool, **kwargs: Any) -> SqueezeNet
Source code in SaigeToolkit/model/backbone/torchvision/squeezenet.py
squeezenet1_0
squeezenet1_0(*, weights: Optional[SqueezeNet1_0_Weights] = None, progress: bool = True, **kwargs: Any) -> SqueezeNet
SqueezeNet model architecture from the SqueezeNet: AlexNet-level
accuracy with 50x fewer parameters and <0.5MB model size
<https://arxiv.org/abs/1602.07360>_ paper.
Parameters:
-
weights (–class:
~torchvision.models.SqueezeNet1_0_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.SqueezeNet1_0_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.squeezenet.SqueezeNetbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/squeezenet.py>_ for more details about this class.
.. autoclass:: torchvision.models.SqueezeNet1_0_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/squeezenet.py
squeezenet1_1
squeezenet1_1(*, weights: Optional[SqueezeNet1_1_Weights] = None, progress: bool = True, **kwargs: Any) -> SqueezeNet
SqueezeNet 1.1 model from the official SqueezeNet repo
<https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1>_.
SqueezeNet 1.1 has 2.4x less computation and slightly fewer parameters than SqueezeNet 1.0, without sacrificing accuracy.
Parameters:
-
weights (–class:
~torchvision.models.SqueezeNet1_1_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.SqueezeNet1_1_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.squeezenet.SqueezeNetbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/squeezenet.py>_ for more details about this class.
.. autoclass:: torchvision.models.SqueezeNet1_1_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/squeezenet.py
vgg
__all__
module-attribute
__all__ = ['VGG', 'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', 'vgg16', 'vgg16_bn', 'vgg19', 'vgg19_bn']
cfgs
module-attribute
cfgs: Dict[str, List[Union[str, int]]] = {'A': [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'], 'B': [64, 64, 'M', 128, 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'], 'D': [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512, 'M', 512, 512, 512, 'M'], 'E': [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 256, 'M', 512, 512, 512, 512, 'M', 512, 512, 512, 512, 'M']}
VGG
Bases: Module
Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
forward
load_state_dict
Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
make_layers
make_layers(cfg: List[Union[str, int]], batch_norm: bool = False, in_channels: int = 3) -> Sequential
Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
_vgg
_vgg(cfg: str, batch_norm: bool, weights: Optional[WeightsEnum], progress: bool, in_channels: int = 3, **kwargs: Any) -> VGG
Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
vgg11
vgg11(*, weights: Optional[VGG11_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG
VGG-11 from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.
Parameters:
-
weights (–class:
~torchvision.models.VGG11_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG11_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.vgg.VGGbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.
.. autoclass:: torchvision.models.VGG11_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
vgg11_bn
vgg11_bn(*, weights: Optional[VGG11_BN_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG
VGG-11-BN from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.
Parameters:
-
weights (–class:
~torchvision.models.VGG11_BN_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG11_BN_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.vgg.VGGbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.
.. autoclass:: torchvision.models.VGG11_BN_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
vgg13
vgg13(*, weights: Optional[VGG13_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG
VGG-13 from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.
Parameters:
-
weights (–class:
~torchvision.models.VGG13_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG13_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.vgg.VGGbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.
.. autoclass:: torchvision.models.VGG13_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
vgg13_bn
vgg13_bn(*, weights: Optional[VGG13_BN_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG
VGG-13-BN from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.
Parameters:
-
weights (–class:
~torchvision.models.VGG13_BN_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG13_BN_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.vgg.VGGbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.
.. autoclass:: torchvision.models.VGG13_BN_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
vgg16
vgg16(*, weights: Optional[VGG16_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG
VGG-16 from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.
Parameters:
-
weights (–class:
~torchvision.models.VGG16_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG16_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.vgg.VGGbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.
.. autoclass:: torchvision.models.VGG16_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
vgg16_bn
vgg16_bn(*, weights: Optional[VGG16_BN_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG
VGG-16-BN from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.
Parameters:
-
weights (–class:
~torchvision.models.VGG16_BN_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG16_BN_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.vgg.VGGbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.
.. autoclass:: torchvision.models.VGG16_BN_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
vgg19
vgg19(*, weights: Optional[VGG19_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG
VGG-19 from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.
Parameters:
-
weights (–class:
~torchvision.models.VGG19_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG19_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.vgg.VGGbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.
.. autoclass:: torchvision.models.VGG19_Weights :members:
Source code in SaigeToolkit/model/backbone/torchvision/vgg.py
vgg19_bn
vgg19_bn(*, weights: Optional[VGG19_BN_Weights] = None, progress: bool = True, **kwargs: Any) -> VGG
VGG-19_BN from Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>__.
Parameters:
-
weights (–class:
~torchvision.models.VGG19_BN_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.VGG19_BN_Weightsbelow for more details, and possible values. By default, no pre-trained weights are used. -
progress(bool, default:True) –If True, displays a progress bar of the download to stderr. Default is True.
-
**kwargs(Any, default:{}) –parameters passed to the
torchvision.models.vgg.VGGbase class. Please refer to thesource code <https://github.com/pytorch/vision/blob/main/torchvision/models/vgg.py>_ for more details about this class.
.. autoclass:: torchvision.models.VGG19_BN_Weights :members: