MCPcopy Create free account
hub / github.com/MAC-VO/MAC-VO / select_point

Method select_point

Module/KeypointSelector.py:107–111  ·  view source on GitHub ↗
(self, frame: StereoData, numPoint: int, depth0_est: IStereoDepth.Output, depth1_est: IStereoDepth.Output, match_est: IMatcher.Output | None)

Source from the content-addressed store, hash-verified

105 Uniformly random select keypoints within the scope of [mask_width : -mask_width]
106 """
107 def select_point(self, frame: StereoData, numPoint: int, depth0_est: IStereoDepth.Output, depth1_est: IStereoDepth.Output, match_est: IMatcher.Output | None) -> torch.Tensor:
108 h_indices = torch.randint(self.config.mask_width, frame.height - self.config.mask_width, (numPoint, 1), device=self.config.device)
109 w_indices = torch.randint(self.config.mask_width, frame.width - self.config.mask_width, (numPoint, 1), device=self.config.device)
110 kps = torch.cat([w_indices, h_indices], dim=1)
111 return kps
112
113 @classmethod
114 def is_valid_config(cls, config: SimpleNamespace | None) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected