File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
segmentation_models_pytorch Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 26
26
27
27
# Suppress the specific SyntaxWarning for `pretrainedmodels`
28
28
warnings .filterwarnings ("ignore" , message = "is with a literal" , category = SyntaxWarning )
29
- warnings .filterwarnings ("ignore" , message = r'"is" with \'str\' literal.*' , category = SyntaxWarning ) # for python >= 3.12
29
+ warnings .filterwarnings (
30
+ "ignore" , message = r'"is" with \'str\' literal.*' , category = SyntaxWarning
31
+ ) # for python >= 3.12
30
32
31
33
32
34
def create_model (
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class DeepLabV3(SegmentationModel):
43
43
- dropout (float): Dropout factor in [0, 1)
44
44
- activation (str): An activation function to apply "sigmoid"/"softmax"
45
45
(could be **None** to return logits)
46
- kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models.
46
+ kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models.
47
47
Keys with ``None`` values are pruned before passing.
48
48
49
49
Returns:
@@ -79,7 +79,7 @@ def __init__(
79
79
encoder_output_stride
80
80
)
81
81
)
82
-
82
+
83
83
self .encoder = get_encoder (
84
84
encoder_name ,
85
85
in_channels = in_channels ,
@@ -91,7 +91,7 @@ def __init__(
91
91
92
92
if upsampling is None :
93
93
if encoder_depth <= 3 :
94
- scale_factor = 2 ** encoder_depth
94
+ scale_factor = 2 ** encoder_depth
95
95
else :
96
96
scale_factor = encoder_output_stride
97
97
else :
@@ -153,7 +153,7 @@ class DeepLabV3Plus(SegmentationModel):
153
153
- dropout (float): Dropout factor in [0, 1)
154
154
- activation (str): An activation function to apply "sigmoid"/"softmax"
155
155
(could be **None** to return logits)
156
- kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models.
156
+ kwargs: Arguments passed to the encoder class ``__init__()`` function. Applies only to ``timm`` models.
157
157
Keys with ``None`` values are pruned before passing.
158
158
159
159
Returns:
You can’t perform that action at this time.
0 commit comments