args: x: H W
(x: torch.tensor,
logger_tf = None, title: str = "depth", step: int = 0)
| 796 | |
| 797 | |
| 798 | def 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 | |
| 816 | def vis_pcd( |
| 817 | rgbs: torch.Tensor, |