vgg
model.backbone.torchvision.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
extend_state_dict_input_channel
extend_state_dict_input_channel(state_dict: Mapping[str, Any], input_weight_key: str, input_conv_layer: Conv2d) -> None
(Multipage) 3채널 이상인 이미지를 사용하기 위해 필요한 기능이며, state_dict의 input conv 채널이 네트워크의 input conv 채널보다 작은 경우 해당 weight의 채널을 늘려줍니다. 현재 네트워크가 가진 input conv 웨이트에서 앞 3 채널을 state_dict의 input conv 웨이트로 치환하는 방식을 사용합니다.
Parameters:
-
state_dict(Mapping[str, Any]) –로드하려는 weight
-
input_weight_key(str) –input conv weight의 이름
-
input_conv_layer(Conv2d) –input conv layer
Source code in SaigeToolkit/model/util.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: