src.clustering.sampling_decorated_clusterer

Classes

SamplingDecoratedClusterer(**kwargs)

class src.clustering.sampling_decorated_clusterer.SamplingDecoratedClusterer(**kwargs)
Author:

Alberto M. Esmoris Pena

Abstract class providing the common logic for clusterer decorators that resample the point cloud.

Variables:

decorated_clusterer_spec (dict) – The specification of the decorated clusterer.

static extract_clustering_args(spec)

Extract the arguments to initialize/instantiate a FPSDecoratedClusterer from a key-word specification.

Parameters:

spec – The key-word specification containing the arguments.

Returns:

The arguments to initialize/instantiate a FPSDecoratedClusterer.

Return type:

dict

__init__(**kwargs)

Initialization for any instance of type SamplingDecoratedClusterer.

fit(pcloud)

Fit a clustering model to a given input point cloud.

In doing so, the clustering model is fit to a sampled representation of the input point cloud.

See Clusterer and Clusterer.fit().

cluster(pcloud)

Clustering from a given input point cloud.

In doing so, the clustering model is computed on a sampled representation of the input point cloud.

See Clusterer and Clusterer.cluster().

post_process(pcloud)

Run the post-processing pipeline on the given input point cloud.

In doing so, the post-processing pipeline is computed on a sampled representation of the input point cloud.

See Clusterer and Clusterer.post_process().

fit_cluster_and_post_process(pcloud, out_prefix=None)

Compute the fitting, clustering, and post-processing as a whole.

In doing so, the sampled representation of the input point cloud is computed once and used to fit, cluster, and post-process with the propagations applied after all the previous methods have been called.

See Clusterer and Clusterer.fit_cluster_and_post_process().

abstractmethod propagate(sampled_pcloud, pcloud)

Method that must be implemented by any non-abstract class extending SamplingDecoratedCluterer to provide the logic to propagate the cluster labels from the sampled point cloud back to the original one. In many cases the SamplingDecoratedClusterer._propagate() method has all the necessary logic provided that it is called with the adequate decorator.

Parameters:
  • sampled_pcloud (PointCloud) – The sampled point cloud whose cluster labels must be propagated to the original point cloud.

  • pcloud (PointCloud) – The original point cloud that will receive the cluster labels propagated from the sampled point cloud.

Returns:

The original point cloud updated with the cluster labels from the sampled point cloud.

Return type:

PointCloud.