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

Function vis_pcd

preprocess/SpaTrackV2_code/models/utils.py:816–848  ·  view source on GitHub ↗

args: rgbs: [S C H W] R: [S 3 3] T: [S 3] xy_depth: [S H W 3] focal_length: [S] pick_idx: list of the index to pick

(
        rgbs: torch.Tensor,
        R: torch.Tensor,
        T: torch.Tensor,
        xy_depth: torch.Tensor,
        focal_length: torch.Tensor,
        pick_idx: List = [0]
        )

Source from the content-addressed store, hash-verified

814 return depth_map_tensor
815
816def vis_pcd(
817 rgbs: torch.Tensor,
818 R: torch.Tensor,
819 T: torch.Tensor,
820 xy_depth: torch.Tensor,
821 focal_length: torch.Tensor,
822 pick_idx: List = [0]
823 ):
824 """
825 args:
826 rgbs: [S C H W]
827 R: [S 3 3]
828 T: [S 3]
829 xy_depth: [S H W 3]
830 focal_length: [S]
831 pick_idx: list of the index to pick
832 """
833 S, C, H, W = rgbs.shape
834
835 rgbs_pick = rgbs[pick_idx]
836 R_pick = R[pick_idx]
837 T_pick = T[pick_idx]
838 xy_depth_pick = xy_depth[pick_idx]
839 focal_length_pick = focal_length[pick_idx]
840 pcd_world = depth2pcd(xy_depth_pick.clone(),
841 focal_length_pick, R_pick.clone(), T_pick.clone(),
842 device=xy_depth.device, H=H, W=W)
843 pcd_world = pcd_world.permute(0, 2, 1) #[...,[1,0,2]]
844 mask = pcd_world.reshape(-1,3)[:,2] < 20
845 rgb_world = rgbs_pick.view(len(pick_idx), 3, -1).permute(0, 2, 1)
846 pcl = Pointclouds(points=[pcd_world.reshape(-1,3)[mask]],
847 features=[rgb_world.reshape(-1,3)[mask]/255])
848 return pcl
849
850def vis_result(rgbs, poses_pred, poses_gt,
851 depth_gt, depth_pred, iter_num=0,

Callers 1

vis_resultFunction · 0.85

Calls 1

depth2pcdFunction · 0.85

Tested by

no test coverage detected