File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-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
4
6
class TestFpnModel (base .BaseModelTester ):
5
7
test_model_type = "fpn"
6
8
files_for_diff = [r"decoders/fpn/" , r"base/" ]
9
+
10
+ def test_interpolation (self ):
11
+
12
+ # test bilinear
13
+ model_1 = smp .create_model (
14
+ self .test_model_type ,
15
+ self .test_encoder_name ,
16
+ decoder_interpolation = "bilinear" ,
17
+ )
18
+ assert model_1 .decoder .p2 .interpolation_mode == "bilinear"
19
+ assert model_1 .decoder .p3 .interpolation_mode == "bilinear"
20
+ assert model_1 .decoder .p4 .interpolation_mode == "bilinear"
21
+
22
+ # test bicubic
23
+ model_2 = smp .create_model (
24
+ self .test_model_type ,
25
+ self .test_encoder_name ,
26
+ decoder_interpolation = "bicubic" ,
27
+ )
28
+ assert model_2 .decoder .p2 .interpolation_mode == "bicubic"
29
+ assert model_2 .decoder .p3 .interpolation_mode == "bicubic"
30
+ assert model_2 .decoder .p4 .interpolation_mode == "bicubic"
You can’t perform that action at this time.
0 commit comments