File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,9 @@ def test_in_channels_and_depth_and_out_classes(
99
99
if self .model_type in ["unet" , "unetplusplus" , "manet" ]:
100
100
kwargs = {"decoder_channels" : self .decoder_channels [:depth ]}
101
101
102
+ if self .model_type == "dpt" :
103
+ kwargs = {"decoder_intermediate_channels" : self .decoder_channels [:depth ]}
104
+
102
105
model = (
103
106
smp .create_model (
104
107
arch = self .model_type ,
Original file line number Diff line number Diff line change 1
1
import pytest
2
+ import inspect
2
3
import torch
3
4
import segmentation_models_pytorch as smp
4
5
@@ -22,6 +23,11 @@ class TestDPTModel(base.BaseModelTester):
22
23
23
24
compile_dynamic = False
24
25
26
+ @property
27
+ def decoder_channels (self ):
28
+ signature = inspect .signature (self .model_class )
29
+ return signature .parameters ["decoder_intermediate_channels" ].default
30
+
25
31
@property
26
32
def hub_checkpoint (self ):
27
33
return "smp-test-models/dpt-tu-test_vit"
You can’t perform that action at this time.
0 commit comments