gberton commited on
Commit
2bc3590
·
verified ·
1 Parent(s): fb1071a

Upload configuration_dpt.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. configuration_dpt.py +35 -0
configuration_dpt.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """TIPSv2 DPT head configuration."""
2
+
3
+ from transformers import PretrainedConfig
4
+
5
+
6
+ class TIPSv2DPTConfig(PretrainedConfig):
7
+ """Configuration for TIPSv2 DPT dense prediction heads."""
8
+
9
+ model_type = "tipsv2_dpt"
10
+
11
+ def __init__(
12
+ self,
13
+ backbone_repo="google/tipsv2-l14",
14
+ embed_dim=1024,
15
+ channels=256,
16
+ post_process_channels=(128, 256, 512, 1024),
17
+ block_indices=(5, 11, 17, 23),
18
+ readout_type="project",
19
+ num_depth_bins=256,
20
+ min_depth=1e-3,
21
+ max_depth=10.0,
22
+ num_seg_classes=150,
23
+ **kwargs,
24
+ ):
25
+ super().__init__(**kwargs)
26
+ self.backbone_repo = backbone_repo
27
+ self.embed_dim = embed_dim
28
+ self.channels = channels
29
+ self.post_process_channels = list(post_process_channels)
30
+ self.block_indices = list(block_indices)
31
+ self.readout_type = readout_type
32
+ self.num_depth_bins = num_depth_bins
33
+ self.min_depth = min_depth
34
+ self.max_depth = max_depth
35
+ self.num_seg_classes = num_seg_classes