Skip to content

Commit ee570f9

Browse files
committed
Add test for fpn
1 parent 138f6ae commit ee570f9

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/models/test_fpn.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
1+
import segmentation_models_pytorch as smp
2+
13
from tests.models import base
24

35

46
class TestFpnModel(base.BaseModelTester):
57
test_model_type = "fpn"
68
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"

0 commit comments

Comments
 (0)