Skip to content

Commit d9ab82a

Browse files
authored
add upsampling parameter qubvel-org#1106 (qubvel-org#1123)
* add upsampling parameter qubvel-org#1106 * docstring upsampling parameter qubvel-org#1123
1 parent 9532612 commit d9ab82a

File tree

1 file changed

+3
-1
lines changed
  • segmentation_models_pytorch/decoders/segformer

1 file changed

+3
-1
lines changed

segmentation_models_pytorch/decoders/segformer/model.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class Segformer(SegmentationModel):
2929
activation: An activation function to apply after the final convolution layer.
3030
Available options are **"sigmoid"**, **"softmax"**, **"logsoftmax"**, **"tanh"**, **"identity"**,
3131
**callable** and **None**. Default is **None**.
32+
upsampling: A number to upsample the output of the model, default is 4 (same size as input)
3233
aux_params: Dictionary with parameters of the auxiliary output (classification head). Auxiliary output is build
3334
on top of encoder if **aux_params** is not **None** (default). Supported params:
3435
- classes (int): A number of classes
@@ -56,6 +57,7 @@ def __init__(
5657
in_channels: int = 3,
5758
classes: int = 1,
5859
activation: Optional[Union[str, Callable]] = None,
60+
upsampling: int = 4,
5961
aux_params: Optional[dict] = None,
6062
**kwargs: dict[str, Any],
6163
):
@@ -80,7 +82,7 @@ def __init__(
8082
out_channels=classes,
8183
activation=activation,
8284
kernel_size=1,
83-
upsampling=4,
85+
upsampling=upsampling,
8486
)
8587

8688
if aux_params is not None:

0 commit comments

Comments
 (0)