detectionmetrics.models.torch_model_utils package
Submodules
detectionmetrics.models.torch_model_utils.o3d_randlanet module
- detectionmetrics.models.torch_model_utils.o3d_randlanet.transform_input(points: ndarray, cfg: dict, sampler: Sampler | None = None) Tuple[Tuple[torch.Tensor, List[torch.Tensor], List[torch.Tensor], List[torch.Tensor], List[torch.Tensor]], ndarray]
Transform point cloud data into input data for the model
- Parameters:
points (np.ndarray) – Point cloud data
cfg (dict) – Dictionary containing model configuration file
sampler (Optional[ul.Sampler], optional) – Object for sampling point cloud, defaults to None
- Returns:
Model input data and selected indices
- Return type:
Tuple[ Tuple[ torch.Tensor, List[torch.Tensor], List[torch.Tensor], List[torch.Tensor], List[torch.Tensor], ], np.ndarray, ]
- detectionmetrics.models.torch_model_utils.o3d_randlanet.update_probs(new_probs: torch.Tensor, indices: torch.Tensor, test_probs: torch.Tensor, n_classes: int, weight: float = 0.95) torch.Tensor
Update test probabilities with new model output using weighted average for a smooth transition between predictions
- Parameters:
new_probs (torch.Tensor) – New probabilities to be added to the test probabilities
indices (torch.Tensor) – Corresponding indices of the new probabilities
test_probs (torch.Tensor) – Test probabilities to be updated
n_classes (int) – Number of classes
weight (float, optional) – Weight used in the weighted average, defaults to 0.95
- Returns:
Updated test probabilities
- Return type:
torch.Tensor
Module contents
- detectionmetrics.models.torch_model_utils.preprocess(points: ndarray, cfg: dict | None = {}) Tuple[ndarray, KDTree, ndarray]
Preprocess point cloud data
- Parameters:
points (np.ndarray) – Point cloud data
cfg (Optional[dict], optional) – Dictionary containing model configuration, defaults to {}
- Returns:
Subsampled points, search tree, and projected indices
- Return type:
Tuple[np.ndarray, KDTree, np.ndarray]