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

Function get_cur_depth_range_samples_n

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

Source from the content-addressed store, hash-verified

474
475
476def get_cur_depth_range_samples_n(last_depth, ndepth, depth_inteval_pixel):
477 # cur_depth: (B, H, W)
478 # return depth_range_values: (B, D, H, W)
479 last_depth_min = (last_depth - (ndepth+2) / 2 * depth_inteval_pixel) # (B, H, W)
480 last_depth_max = (last_depth + (ndepth-2) / 2 * depth_inteval_pixel)
481 # cur_depth_min = (cur_depth - ndepth / 2 * depth_inteval_pixel).clamp(min=0.0) #(B, H, W)
482 # cur_depth_max = (cur_depth_min + (ndepth - 1) * depth_inteval_pixel).clamp(max=max_depth)
483
484 new_interval = (last_depth_max - last_depth_min) / (ndepth - 1) # (B, H, W)
485
486 depth_range_samples = last_depth_min.unsqueeze(1) + (torch.arange(0, ndepth, device=last_depth.device,
487 dtype=last_depth.dtype,
488 requires_grad=False).reshape(1, -1, 1,
489 1) * new_interval.unsqueeze(1))
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)

Callers 1

get_depth_range_samplesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected