MCPcopy Create free account
hub / github.com/apple/ARKitScenes / __init__

Method __init__

depth_upsampling/models/msg/msg.py:15–41  ·  view source on GitHub ↗
(self, upsampling_factor)

Source from the content-addressed store, hash-verified

13 http://personal.ie.cuhk.edu.hk/~ccloy/files/eccv_2016_depth.pdf
14 """
15 def __init__(self, upsampling_factor):
16 super().__init__()
17 # initialize indexes for layers
18 self.upsampling_factor = upsampling_factor
19 m = int(np.log2(upsampling_factor))
20
21 # RGB-branch
22 self.rgb_encoder1 = nn.Sequential(ConvPReLu(3, 49, 7, stride=1, padding=3),
23 ConvPReLu(49, 32))
24 self.rgb_encoder_blocks = nn.ModuleList()
25 for i in range(m-1):
26 self.rgb_encoder_blocks.append(nn.Sequential(ConvPReLu(32, 32),
27 nn.MaxPool2d(3, 2, padding=1)))
28
29 # D-branch
30 self.depth_decoder1 = nn.Sequential(ConvPReLu(1, 64, 5, stride=1, padding=2),
31 DeconvPReLu(64, 32, 5, stride=2, padding=2))
32 self.depth_decoder_blocks = nn.ModuleList()
33 for i in range(m-1):
34 self.depth_decoder_blocks.append(nn.Sequential(ConvPReLu(64, 32, 5, stride=1, padding=2),
35 ConvPReLu(32, 32, 5, stride=1, padding=2),
36 DeconvPReLu(32, 32, 5, stride=2, padding=2)))
37
38 self.depth_decoder_n = nn.Sequential(ConvPReLu(64, 32, 5, stride=1, padding=2),
39 ConvPReLu(32, 32, 5, stride=1, padding=2),
40 ConvPReLu(32, 32, 5, stride=1, padding=2),
41 ConvPReLu(32, 1, 5, stride=1, padding=2))
42
43 def forward(self, batch):
44 rgb_img = batch[dataset_keys.COLOR_IMG] / 255

Callers

nothing calls this directly

Calls 2

ConvPReLuClass · 0.85
DeconvPReLuClass · 0.85

Tested by

no test coverage detected