MCPcopy Create free account
hub / github.com/DIVE128/DMVSNet / get_cur_depth_range_samples_p

Function get_cur_depth_range_samples_p

networks/module.py:492–507  ·  view source on GitHub ↗
(last_depth, ndepth, depth_inteval_pixel)

Source from the content-addressed store, hash-verified

490
491 return depth_range_samples, (ndepth * depth_inteval_pixel) / (ndepth - 1)
492def get_cur_depth_range_samples_p(last_depth, ndepth, depth_inteval_pixel):
493 # cur_depth: (B, H, W)
494 # return depth_range_values: (B, D, H, W)
495 last_depth_min = (last_depth - (ndepth-2) / 2 * depth_inteval_pixel) # (B, H, W)
496 last_depth_max = (last_depth + (ndepth+2) / 2 * depth_inteval_pixel)
497 # cur_depth_min = (cur_depth - ndepth / 2 * depth_inteval_pixel).clamp(min=0.0) #(B, H, W)
498 # cur_depth_max = (cur_depth_min + (ndepth - 1) * depth_inteval_pixel).clamp(max=max_depth)
499
500 new_interval = (last_depth_max - last_depth_min) / (ndepth - 1) # (B, H, W)
501
502 depth_range_samples = last_depth_min.unsqueeze(1) + (torch.arange(0, ndepth, device=last_depth.device,
503 dtype=last_depth.dtype,
504 requires_grad=False).reshape(1, -1, 1,
505 1) * new_interval.unsqueeze(1))
506
507 return depth_range_samples, (ndepth * depth_inteval_pixel) / (ndepth - 1)
508
509def get_cur_depth_range_samples_inverse(last_depth, ndepth, depth_inteval_pixel):
510 # cur_depth: (B, H, W)

Callers 1

get_depth_range_samplesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected