Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions segmentation_models_pytorch/decoders/deeplabv3/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ class DeepLabV3(SegmentationModel):
upsampling: Final upsampling factor. Default is **None** to preserve input-output spatial shape identity
aux_params: Dictionary with parameters of the auxiliary output (classification head). Auxiliary output is build
on top of encoder if **aux_params** is not **None** (default). Supported params:
- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)

- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)
kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models.
Keys with ``None`` values are pruned before passing.

Expand Down Expand Up @@ -167,11 +168,12 @@ class DeepLabV3Plus(SegmentationModel):
upsampling: Final upsampling factor. Default is 4 to preserve input-output spatial shape identity.
aux_params: Dictionary with parameters of the auxiliary output (classification head). Auxiliary output is build
on top of encoder if **aux_params** is not **None** (default). Supported params:
- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)

- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)
kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models.
Keys with ``None`` values are pruned before passing.

Expand Down
11 changes: 6 additions & 5 deletions segmentation_models_pytorch/decoders/fpn/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ class FPN(SegmentationModel):
upsampling: Final upsampling factor. Default is 4 to preserve input-output spatial shape identity
aux_params: Dictionary with parameters of the auxiliary output (classification head). Auxiliary output is build
on top of encoder if **aux_params** is not **None** (default). Supported params:
- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)

- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)
kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models. Keys with ``None`` values are pruned before passing.

Returns:
Expand Down
12 changes: 7 additions & 5 deletions segmentation_models_pytorch/decoders/linknet/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Linknet(SegmentationModel):
random initialization. The pretrained variant is defined in the encoder name
decoder_use_norm: Specifies normalization between Conv2D and activation.
Accepts the following types:

- **True**: Defaults to `"batchnorm"`.
- **False**: No normalization (`nn.Identity`).
- **str**: Specifies normalization type using default parameters. Available values:
Expand All @@ -55,11 +56,12 @@ class Linknet(SegmentationModel):
**callable** and **None**. Default is **None**.
aux_params: Dictionary with parameters of the auxiliary output (classification head). Auxiliary output is build
on top of encoder if **aux_params** is not **None** (default). Supported params:
- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)

- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)
kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models. Keys with ``None`` values are pruned before passing.

Returns:
Expand Down
19 changes: 11 additions & 8 deletions segmentation_models_pytorch/decoders/manet/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
class MAnet(SegmentationModel):
"""MAnet_ : Multi-scale Attention Net. The MA-Net can capture rich contextual dependencies based on
the attention mechanism, using two blocks:
- Position-wise Attention Block (PAB), which captures the spatial dependencies between pixels in a global view
- Multi-scale Fusion Attention Block (MFAB), which captures the channel dependencies between any feature map by
multi-scale semantic feature fusion

- Position-wise Attention Block (PAB), which captures the spatial dependencies between pixels in a global view
- Multi-scale Fusion Attention Block (MFAB), which captures the channel dependencies between any feature map by
multi-scale semantic feature fusion

Args:
encoder_name: Name of the classification model that will be used as an encoder (a.k.a backbone)
Expand All @@ -34,6 +35,7 @@ class MAnet(SegmentationModel):
Length of the list should be the same as **encoder_depth**
decoder_use_norm: Specifies normalization between Conv2D and activation.
Accepts the following types:

- **True**: Defaults to `"batchnorm"`.
- **False**: No normalization (`nn.Identity`).
- **str**: Specifies normalization type using default parameters. Available values:
Expand All @@ -59,11 +61,12 @@ class MAnet(SegmentationModel):
**callable** and **None**. Default is **None**.
aux_params: Dictionary with parameters of the auxiliary output (classification head). Auxiliary output is build
on top of encoder if **aux_params** is not **None** (default). Supported params:
- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)

- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)
kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models. Keys with ``None`` values are pruned before passing.

Returns:
Expand Down
11 changes: 6 additions & 5 deletions segmentation_models_pytorch/decoders/pan/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ class PAN(SegmentationModel):
upsampling: Final upsampling factor. Default is 4 to preserve input-output spatial shape identity
aux_params: Dictionary with parameters of the auxiliary output (classification head). Auxiliary output is build
on top of encoder if **aux_params** is not **None** (default). Supported params:
- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)

- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)
kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models. Keys with ``None`` values are pruned before passing.

Returns:
Expand Down
12 changes: 7 additions & 5 deletions segmentation_models_pytorch/decoders/pspnet/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class PSPNet(SegmentationModel):
psp_out_channels: A number of filters in Spatial Pyramid
decoder_use_norm: Specifies normalization between Conv2D and activation.
Accepts the following types:

- **True**: Defaults to `"batchnorm"`.
- **False**: No normalization (`nn.Identity`).
- **str**: Specifies normalization type using default parameters. Available values:
Expand All @@ -56,11 +57,12 @@ class PSPNet(SegmentationModel):
upsampling: Final upsampling factor. Default is 8 to preserve input-output spatial shape identity
aux_params: Dictionary with parameters of the auxiliary output (classification head). Auxiliary output is build
on top of encoder if **aux_params** is not **None** (default). Supported params:
- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)

- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)
kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models. Keys with ``None`` values are pruned before passing.

Returns:
Expand Down
11 changes: 6 additions & 5 deletions segmentation_models_pytorch/decoders/segformer/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ class Segformer(SegmentationModel):
upsampling: A number to upsample the output of the model, default is 4 (same size as input)
aux_params: Dictionary with parameters of the auxiliary output (classification head). Auxiliary output is build
on top of encoder if **aux_params** is not **None** (default). Supported params:
- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)

- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)
kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models. Keys with ``None`` values are pruned before passing.

Returns:
Expand Down
12 changes: 7 additions & 5 deletions segmentation_models_pytorch/decoders/unet/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Unet(SegmentationModel):
Length of the list should be the same as **encoder_depth**
decoder_use_norm: Specifies normalization between Conv2D and activation.
Accepts the following types:

- **True**: Defaults to `"batchnorm"`.
- **False**: No normalization (`nn.Identity`).
- **str**: Specifies normalization type using default parameters. Available values:
Expand All @@ -69,11 +70,12 @@ class Unet(SegmentationModel):
**callable** and **None**. Default is **None**.
aux_params: Dictionary with parameters of the auxiliary output (classification head). Auxiliary output is build
on top of encoder if **aux_params** is not **None** (default). Supported params:
- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)

- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)
kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models. Keys with ``None`` values are pruned before passing.

Returns:
Expand Down
12 changes: 7 additions & 5 deletions segmentation_models_pytorch/decoders/unetplusplus/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class UnetPlusPlus(SegmentationModel):
Length of the list should be the same as **encoder_depth**
decoder_use_norm: Specifies normalization between Conv2D and activation.
Accepts the following types:

- **True**: Defaults to `"batchnorm"`.
- **False**: No normalization (`nn.Identity`).
- **str**: Specifies normalization type using default parameters. Available values:
Expand All @@ -58,11 +59,12 @@ class UnetPlusPlus(SegmentationModel):
**callable** and **None**. Default is **None**.
aux_params: Dictionary with parameters of the auxiliary output (classification head). Auxiliary output is build
on top of encoder if **aux_params** is not **None** (default). Supported params:
- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)

- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)
kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models. Keys with ``None`` values are pruned before passing.

Returns:
Expand Down
12 changes: 7 additions & 5 deletions segmentation_models_pytorch/decoders/upernet/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class UPerNet(SegmentationModel):
decoder_segmentation_channels: A number of convolution filters in segmentation blocks, default is 64
decoder_use_norm: Specifies normalization between Conv2D and activation.
Accepts the following types:

- **True**: Defaults to `"batchnorm"`.
- **False**: No normalization (`nn.Identity`).
- **str**: Specifies normalization type using default parameters. Available values:
Expand All @@ -50,11 +51,12 @@ class UPerNet(SegmentationModel):
**callable** and **None**. Default is **None**.
aux_params: Dictionary with parameters of the auxiliary output (classification head). Auxiliary output is build
on top of encoder if **aux_params** is not **None** (default). Supported params:
- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)

- classes (int): A number of classes
- pooling (str): One of "max", "avg". Default is "avg"
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)
kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models. Keys with ``None`` values are pruned before passing.

Returns:
Expand Down
Loading