@@ -31,7 +31,7 @@ class PAN(SegmentationModel):
31
31
encoder_output_stride: 16 or 32, if 16 use dilation in encoder last layer.
32
32
Doesn't work with ***ception***, **vgg***, **densenet*`** backbones.Default is 16.
33
33
decoder_channels: A number of convolution layer filters in decoder blocks
34
- decoder_interpolation_mode : Interpolation mode used in decoder of the model. Available options are
34
+ decoder_interpolation : Interpolation mode used in decoder of the model. Available options are
35
35
**"nearest"**, **"bilinear"**, **"bicubic"**, **"area"**, **"nearest-exact"**. Default is **"bilinear"**.
36
36
in_channels: A number of input channels for the model, default is 3 (RGB images)
37
37
classes: A number of classes for output mask (or you can think as a number of channels of output mask)
@@ -65,7 +65,7 @@ def __init__(
65
65
encoder_weights : Optional [str ] = "imagenet" ,
66
66
encoder_output_stride : Literal [16 , 32 ] = 16 ,
67
67
decoder_channels : int = 32 ,
68
- decoder_interpolation_mode : str = "bilinear" ,
68
+ decoder_interpolation : str = "bilinear" ,
69
69
in_channels : int = 3 ,
70
70
classes : int = 1 ,
71
71
activation : Optional [Union [str , Callable ]] = None ,
@@ -82,6 +82,15 @@ def __init__(
82
82
)
83
83
)
84
84
85
+ upscale_mode = kwargs .pop ("upscale_mode" , None )
86
+ if upscale_mode is not None :
87
+ warnings .warn (
88
+ "The usage of upscale_mode is deprecated. Please modify your code for decoder_interpolation" ,
89
+ DeprecationWarning ,
90
+ stacklevel = 2 ,
91
+ )
92
+ decoder_interpolation = upscale_mode
93
+
85
94
self .encoder = get_encoder (
86
95
encoder_name ,
87
96
in_channels = in_channels ,
@@ -91,20 +100,11 @@ def __init__(
91
100
** kwargs ,
92
101
)
93
102
94
- upscale_mode = kwargs .pop ("upscale_mode" , None )
95
- if upscale_mode is not None :
96
- warnings .warn (
97
- "The usage of upscale_mode is deprecated. Please modify your code for decoder_interpolation_mode" ,
98
- DeprecationWarning ,
99
- stacklevel = 2 ,
100
- )
101
- decoder_interpolation_mode = upscale_mode
102
-
103
103
self .decoder = PANDecoder (
104
104
encoder_channels = self .encoder .out_channels ,
105
105
encoder_depth = encoder_depth ,
106
106
decoder_channels = decoder_channels ,
107
- decoder_interpolation_mode = decoder_interpolation_mode ,
107
+ interpolation_mode = decoder_interpolation ,
108
108
)
109
109
110
110
self .segmentation_head = SegmentationHead (
0 commit comments