MCPcopy Create free account
hub / github.com/UVA-Computer-Vision-Lab/FrameINO / vis_depth

Function vis_depth

preprocess/SpaTrackV2_code/models/utils.py:798–814  ·  view source on GitHub ↗

args: x: H W

(x: torch.tensor,
              logger_tf = None, title: str = "depth", step: int = 0)

Source from the content-addressed store, hash-verified

796
797
798def vis_depth(x: torch.tensor,
799 logger_tf = None, title: str = "depth", step: int = 0):
800 """
801 args:
802 x: H W
803 """
804 assert len(x.shape) == 2
805
806 depth_map_normalized = cv2.normalize(x.cpu().numpy(),
807 None, 0, 255, cv2.NORM_MINMAX)
808 depth_map_colored = cv2.applyColorMap(depth_map_normalized.astype(np.uint8),
809 cv2.COLORMAP_JET)
810 depth_map_tensor = torch.from_numpy(depth_map_colored).permute(2, 0, 1).unsqueeze(0)
811 if logger_tf is not None:
812 logger_tf.add_image(title, depth_map_tensor[0], step)
813 else:
814 return depth_map_tensor
815
816def vis_pcd(
817 rgbs: torch.Tensor,

Callers 1

vis_resultFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected