open3d.ml.torch.models.KPFCNN#

class open3d.ml.torch.models.KPFCNN(name='KPFCNN', lbl_values=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], num_classes=19, ignored_label_inds=[0], ckpt_path=None, batcher='ConcatBatcher', architecture=['simple', 'resnetb', 'resnetb_strided', 'resnetb', 'resnetb', 'resnetb_strided', 'resnetb', 'resnetb', 'resnetb_strided', 'resnetb', 'resnetb', 'resnetb_strided', 'resnetb', 'nearest_upsample', 'unary', 'nearest_upsample', 'unary', 'nearest_upsample', 'unary', 'nearest_upsample', 'unary'], in_radius=4.0, max_in_points=100000, batch_num=8, batch_limit=30000, val_batch_num=8, num_kernel_points=15, first_subsampling_dl=0.06, conv_radius=2.5, deform_radius=6.0, KP_extent=1.2, KP_influence='linear', aggregation_mode='sum', first_features_dim=128, in_features_dim=2, modulated=False, use_batch_norm=True, batch_norm_momentum=0.02, deform_fitting_mode='point2point', deform_fitting_power=1.0, repulse_extent=1.2, augment_scale_anisotropic=True, augment_symmetries=[True, False, False], augment_rotation='vertical', augment_scale_min=0.8, augment_scale_max=1.2, augment_noise=0.001, augment_color=0.8, in_points_dim=3, fixed_kernel_points='center', num_layers=5, l_relu=0.1, reduce_fc=False, **kwargs)#

Class defining KPFCNN.

A model for Semantic Segmentation.

__init__(name='KPFCNN', lbl_values=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], num_classes=19, ignored_label_inds=[0], ckpt_path=None, batcher='ConcatBatcher', architecture=['simple', 'resnetb', 'resnetb_strided', 'resnetb', 'resnetb', 'resnetb_strided', 'resnetb', 'resnetb', 'resnetb_strided', 'resnetb', 'resnetb', 'resnetb_strided', 'resnetb', 'nearest_upsample', 'unary', 'nearest_upsample', 'unary', 'nearest_upsample', 'unary', 'nearest_upsample', 'unary'], in_radius=4.0, max_in_points=100000, batch_num=8, batch_limit=30000, val_batch_num=8, num_kernel_points=15, first_subsampling_dl=0.06, conv_radius=2.5, deform_radius=6.0, KP_extent=1.2, KP_influence='linear', aggregation_mode='sum', first_features_dim=128, in_features_dim=2, modulated=False, use_batch_norm=True, batch_norm_momentum=0.02, deform_fitting_mode='point2point', deform_fitting_power=1.0, repulse_extent=1.2, augment_scale_anisotropic=True, augment_symmetries=[True, False, False], augment_rotation='vertical', augment_scale_min=0.8, augment_scale_max=1.2, augment_noise=0.001, augment_color=0.8, in_points_dim=3, fixed_kernel_points='center', num_layers=5, l_relu=0.1, reduce_fc=False, **kwargs)#

Initialize.

Parameters:
  • cfg (cfg object or str) – cfg object or path to cfg file

  • dataset_path (str) – path to the dataset

  • **kwargs (dict) – Dict of args

augmentation_transform(points, normals=None, verbose=False, is_test=False)#

Implementation of an augmentation transform for point clouds.

big_neighborhood_filter(neighbors, layer)#

Filter neighborhoods with max number of neighbors.

Limit is set to keep XX% of the neighborhoods untouched. Limit is computed at initialization

forward(batch)#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_loss(Loss, results, inputs, device)#

Runs the loss on outputs of the model.

Parameters:
  • outputs – logits

  • labels – labels

Returns:

loss

get_optimizer(cfg_pipeline)#

Returns an optimizer object for the model.

Parameters:

cfg_pipeline – A Config object with the configuration of the pipeline.

Returns:

Returns a new optimizer object.

inference_begin(data)#

Function called right before running inference.

Parameters:

data – A data from the dataset.

inference_end(inputs, results)#

This function is called after the inference.

This function can be implemented to apply post-processing on the network outputs.

Parameters:

results – The model outputs as returned by the call() function. Post-processing is applied on this object.

Returns:

Returns True if the inference is complete and otherwise False. Returning False can be used to implement inference for large point clouds which require multiple passes.

inference_preprocess()#

This function prepares the inputs for the model.

Returns:

The inputs to be consumed by the call() function of the model.

preprocess(data, attr)#

Data preprocessing function.

This function is called before training to preprocess the data from a dataset.

Parameters:
  • data – A sample from the dataset.

  • attr – The corresponding attributes.

Returns:

Returns the preprocessed data

transform(data, attr, is_test=False)#

Transform function for the point cloud and features.

Parameters:

cfg_pipeline – config file for pipeline.

update_probs(inputs, results, test_probs)#