controller#
- class pointrix.controller.gs.DensificationController(cfg: dict | DictConfig | None = None, *args, **kwargs)#
Bases:
BaseDensificationController
The controller class for densifying the point cloud.
- class Config(prune_interval: int = 100, min_opacity: float = 0.005, duplicate_interval: int = 100, densify_start_iter: int = 500, densify_stop_iter: int = 15000, densify_grad_threshold: float = 0.0002, optimizer_name: str = 'optimizer_1', split_num: int = 2, control_module: str = 'point_cloud', percent_dense: float = 0.01, opacity_reset_interval: int = 3000, normalize_grad: bool = True)#
Bases:
Config
- Parameters:
split_num (int) – The number of points to split.
control_module (str) – The control module.
percent_dense (float) – The percentage of dense points.
opacity_reset_interval (int) – The interval to reset the opacity.
densify_grad_threshold (float) – The controller gradient threshold.
min_opacity (float) – The minimum opacity.
normalize_grad (bool) – Whether to normalize the gradient.
- accumulate_viewspace_grad(uv_points: Tensor) Tensor #
Accumulate viewspace gradients for batch.
- Parameters:
uv_points (torch.Tensor) – The view space points.
- Returns:
The viewspace gradients.
- Return type:
torch.Tensor
- densify_clone(grads: Tensor) None #
Densify the point cloud by cloning.
- Parameters:
grads (torch.Tensor) – The gradients.
- densify_split(grads: Tensor) None #
Densify the point cloud by splitting.
- Parameters:
grads (torch.Tensor) – The gradients.
- generate_clone_mask(grads: Tensor) Tensor #
Generate the mask for cloning. :param grads: The gradients. :type grads: torch.Tensor
- Returns:
The mask for cloning.
- Return type:
torch.Tensor
- generate_split_mask(grads: Tensor) Tensor #
Generate the mask for splitting.
- Parameters:
grads (torch.Tensor) – The gradients.
- new_pos_scale(mask: Tensor) Tuple[Tensor, Tensor] #
Generate new position and scaling for splitting.
- Parameters:
mask (torch.Tensor) – The mask for splitting.
- Returns:
The new position and scaling.
- Return type:
tuple[torch.Tensor, torch.Tensor]
- prune(**kwargs) None #
Prune the point cloud.
- Parameters:
step (int) – The current step.
- prune_postprocess(valid_points_mask)#
Postprocess after pruning.
- Parameters:
valid_points_mask (torch.Tensor) – The mask for valid points.
- reset_controller_state() None #
Reset the controller state.
- reset_opacity(reset_scele=0.01) None #
Reset the opacity of the point cloud.
- Parameters:
reset_scele (float) – The reset scale.