MCPcopy Create free account
hub / github.com/apple/ml-pointersect / __init__

Method __init__

pointersect/inference/structures.py:32–70  ·  view source on GitHub ↗
(
            self,
            xyz_w: torch.Tensor,  # (b, n, 3)
            rgb: T.Optional[torch.Tensor] = None,  # (b, n, 3)
            normal_w: T.Optional[torch.Tensor] = None,  # (b, n, 3)  vertex normal in world coordinate
            captured_z_direction_w: T.Optional[torch.Tensor] = None,
            # (b, n, 3)  # (z axis of the camera in world coordinate)
            captured_dps: T.Optional[torch.Tensor] = None,  # (b, n, 1)  distance per sample
            captured_dps_u_w: T.Optional[torch.Tensor] = None,
            # (b, n, 3)  distance per sample in camera x direction in the word coord
            captured_dps_v_w: T.Optional[torch.Tensor] = None,
            # (b, n, 3)  distance per sample in camera y direction in the word coord
            captured_view_direction_w: T.Optional[torch.Tensor] = None,
            # (b, n, 3)  # unit vector pointing from capturing camera pinhole to the point
            valid_mask: T.Optional[torch.Tensor] = None,  # (b, n, 1)
            included_point_at_inf: bool = False,  # whether n==0 represents point at inf
            feature: T.Optional[torch.Tensor] = None,  # (b, n, f)
            img_idxs: T.Optional[torch.Tensor] = None,  # (b, n, 1)  linear index of qhw in the original rgbd image
    )

Source from the content-addressed store, hash-verified

30
31class PointCloud:
32 def __init__(
33 self,
34 xyz_w: torch.Tensor, # (b, n, 3)
35 rgb: T.Optional[torch.Tensor] = None, # (b, n, 3)
36 normal_w: T.Optional[torch.Tensor] = None, # (b, n, 3) vertex normal in world coordinate
37 captured_z_direction_w: T.Optional[torch.Tensor] = None,
38 # (b, n, 3) # (z axis of the camera in world coordinate)
39 captured_dps: T.Optional[torch.Tensor] = None, # (b, n, 1) distance per sample
40 captured_dps_u_w: T.Optional[torch.Tensor] = None,
41 # (b, n, 3) distance per sample in camera x direction in the word coord
42 captured_dps_v_w: T.Optional[torch.Tensor] = None,
43 # (b, n, 3) distance per sample in camera y direction in the word coord
44 captured_view_direction_w: T.Optional[torch.Tensor] = None,
45 # (b, n, 3) # unit vector pointing from capturing camera pinhole to the point
46 valid_mask: T.Optional[torch.Tensor] = None, # (b, n, 1)
47 included_point_at_inf: bool = False, # whether n==0 represents point at inf
48 feature: T.Optional[torch.Tensor] = None, # (b, n, f)
49 img_idxs: T.Optional[torch.Tensor] = None, # (b, n, 1) linear index of qhw in the original rgbd image
50 ):
51 self.xyz_w = xyz_w
52 self.rgb = rgb
53 self.normal_w = normal_w
54 self.captured_z_direction_w = captured_z_direction_w
55 self.captured_view_direction_w = captured_view_direction_w
56 self.captured_dps = captured_dps
57 self.captured_dps_u_w = captured_dps_u_w
58 self.captured_dps_v_w = captured_dps_v_w
59 self.valid_mask = valid_mask
60 self.feature = feature
61 self.img_idxs = img_idxs
62
63 self.attr_names = [
64 'xyz_w', 'rgb', 'captured_z_direction_w', 'captured_view_direction_w',
65 'captured_dps', 'captured_dps_u_w', 'captured_dps_v_w', 'normal_w',
66 'valid_mask', 'feature', 'img_idxs',
67 ]
68
69 self.included_point_at_inf = included_point_at_inf
70 self.check_dim()
71
72 @staticmethod
73 def from_o3d_pcd(

Callers

nothing calls this directly

Calls 1

check_dimMethod · 0.95

Tested by

no test coverage detected