Skip to content

Commit

Permalink
Add head upsampling to UNetPlusPlus decoder (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
tayden authored Jul 4, 2024
1 parent fbefe71 commit 47a4dd6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions torchseg/decoders/unetplusplus/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class UnetPlusPlus(SegmentationModel):
- dropout (float): Dropout factor in [0, 1)
- activation (str): An activation function to apply "sigmoid"/"softmax"
(could be **None** to return logits)
head_upsampling: Factor to upsample input to segmentation head. Defaults to 1.
This allows for use of U-Net decoder with models that need additional
upsampling to be at the original input image resolution.
Reference:
https://arxiv.org/abs/1807.10165
Expand All @@ -67,6 +70,7 @@ def __init__(
activation: Callable = nn.Identity(),
encoder_params: dict = {},
aux_params: Optional[dict] = None,
head_upsampling: int = 1,
):
super().__init__()

Expand Down Expand Up @@ -97,6 +101,7 @@ def __init__(
out_channels=classes,
activation=activation,
kernel_size=3,
upsampling=head_upsampling,
)

if aux_params is not None:
Expand Down

0 comments on commit 47a4dd6

Please sign in to comment.