File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ import segmentation_models_pytorch as smp
2
+
1
3
from tests .models import base
2
4
3
5
@@ -8,3 +10,30 @@ class TestPanModel(base.BaseModelTester):
8
10
default_batch_size = 2
9
11
default_height = 128
10
12
default_width = 128
13
+
14
+ def test_interpolation (self ):
15
+ # test bilinear
16
+ model_1 = smp .create_model (
17
+ self .test_model_type ,
18
+ self .test_encoder_name ,
19
+ decoder_interpolation = "bilinear" ,
20
+ )
21
+ assert model_1 .decoder .gau1 .interpolation_mode == "bilinear"
22
+ assert model_1 .decoder .gau1 .align_corners is True
23
+ assert model_1 .decoder .gau2 .interpolation_mode == "bilinear"
24
+ assert model_1 .decoder .gau2 .align_corners is True
25
+ assert model_1 .decoder .gau3 .interpolation_mode == "bilinear"
26
+ assert model_1 .decoder .gau3 .align_corners is True
27
+
28
+ # test bicubic
29
+ model_2 = smp .create_model (
30
+ self .test_model_type ,
31
+ self .test_encoder_name ,
32
+ decoder_interpolation = "bicubic" ,
33
+ )
34
+ assert model_2 .decoder .gau1 .interpolation_mode == "bicubic"
35
+ assert model_2 .decoder .gau1 .align_corners is None
36
+ assert model_2 .decoder .gau2 .interpolation_mode == "bicubic"
37
+ assert model_2 .decoder .gau2 .align_corners is None
38
+ assert model_2 .decoder .gau3 .interpolation_mode == "bicubic"
39
+ assert model_2 .decoder .gau3 .align_corners is None
You can’t perform that action at this time.
0 commit comments