MCPcopy Create free account
hub / github.com/M2219/ESMStereo / context_upsample

Function context_upsample

models/submodule.py:202–209  ·  view source on GitHub ↗
(depth_low, up_weights)

Source from the content-addressed store, hash-verified

200 return volume
201
202def context_upsample(depth_low, up_weights):
203
204 b, c, h, w = depth_low.shape
205 depth_unfold = F.unfold(depth_low.reshape(b,c,h,w),3,1,1).reshape(b,-1,h,w)
206 depth_unfold = F.interpolate(depth_unfold,(h*16,w*16),mode='nearest').reshape(b,9,h*16,w*16)
207 depth = (depth_unfold*up_weights).sum(1)
208
209 return depth
210
211def disparity_regression(x, maxdisp):
212 assert len(x.shape) == 4

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected