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

Method get_num_valid_points

pointersect/inference/structures.py:111–122  ·  view source on GitHub ↗

get number of valid points (excluding point at inf) but including the invalid points.

(self, bidx: int)

Source from the content-addressed store, hash-verified

109 return self.xyz_w.size(1)
110
111 def get_num_valid_points(self, bidx: int) -> int:
112 """
113 get number of valid points (excluding point at inf)
114 but including the invalid points.
115 """
116 if self.valid_mask is None:
117 if self.included_point_at_inf:
118 return self.xyz_w.size(1) - 1
119 else:
120 return self.xyz_w.size(1)
121 else:
122 return self.valid_mask[bidx, :].sum().detach().cpu().item()
123
124 def to(self, device: torch.device) -> 'PointCloud':
125 for attr_name in self.attr_names:

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
detachMethod · 0.45

Tested by

no test coverage detected