open3d.ml.tf.models.RandLANet

class open3d.ml.tf.models.RandLANet(*args, **kwargs)

Class defining RandLANet, a Semantic Segmentation model. Based on the architecture https://arxiv.org/abs/1911.11236#

Reference Implementation - https://github.com/QingyongHu/RandLA-Net

__init__(name='RandLANet', k_n=16, num_layers=4, num_points=45056, num_classes=19, ignored_label_inds=[0], sub_sampling_ratio=[4, 4, 4, 4], dim_input=3, dim_feature=8, dim_output=[16, 64, 128, 256], grid_size=0.06, batcher='DefaultBatcher', ckpt_path=None, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

call(inputs, training=True)

Calls the model on new inputs.

In this case call just reapplies all ops in the graph to the new inputs (e.g. build a new computational graph from the provided inputs).

Note: This method should not be called directly. It is only meant to be overridden when subclassing tf.keras.Model. To call a model on an input, always use the __call__ method, i.e. model(inputs), which relies on the underlying call method.

Parameters
  • inputs – A tensor or list of tensors.

  • training – Boolean or boolean scalar tensor, indicating whether to run the Network in training mode or inference mode.

  • mask – A mask or list of masks. A mask can be either a tensor or None (no mask).

Returns

A tensor if there is a single output, or a list of tensors if there are more than one outputs.

forward_att_pooling(feature_set, name)
forward_building_block(xyz, feature, neigh_idx, name)
forward_dilated_res_block(feature, xyz, neigh_idx, dim_output, name)
forward_gather_neighbour(pc, neighbor_idx)
forward_relative_pos_encoding(xyz, neigh_idx)
static gather_neighbour(pc, neighbor_idx)
get_batch_gen(dataset, steps_per_epoch=None, batch_size=1)
get_loss(Loss, results, inputs)

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(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.

init_att_pooling(d, dim_output, name)
init_building_block(dim_input, dim_output, name)
init_dilated_res_block(dim_input, dim_output, name)
static nearest_interpolation(feature, interp_idx)
Parameters
  • feature – [B, N, d] input features matrix

  • interp_idx – [B, up_num_points, 1] nearest neighbour index

Returns

[B, up_num_points, d] interpolated features matrix

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

static random_sample(feature, pool_idx)
Parameters
  • feature – [B, N, d] input features matrix

  • pool_idx – [B, N’, max_num] N’ < N, N’ is the selected position after pooling

Returns

pool_features = [B, N’, d] pooled features matrix

transform(pc, feat, label)

Transform function for the point cloud and features.

Parameters

args – A list of tf Tensors.

transform_inference(data, min_possibility_idx)