open3d.ml.tf.models.SparseConvUnet#

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

Semantic Segmentation model.

Uses UNet architecture replacing convolutions with Sparse Convolutions.

name#

Name of model. Default to “SparseConvUnet”.

device#

Which device to use (cpu or cuda).

voxel_size#

Voxel length for subsampling.

multiplier#

min length of feature length in each layer.

conv_block_reps#

repetition of Unet Blocks.

residual_blocks#

Whether to use Residual Blocks.

in_channels#

Number of features(default 3 for color).

num_classes#

Number of classes.

__init__(name='SparseConvUnet', device='cuda', multiplier=16, voxel_size=0.05, conv_block_reps=1, residual_blocks=False, in_channels=3, num_classes=20, grid_size=4096, augment=None, **kwargs)#
call(inputs, training=False)#
get_batch_gen(dataset, steps_per_epoch=None, batch_size=1)#
get_loss(Loss, results, inputs)#

Calculate the loss on output of the model.

Loss#

Object of type SemSegLoss.

results#

Output of the model.

inputs#

Input of the model.

device#

device(cpu or cuda).

Returns:

Returns loss, labels and scores.

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.

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(point, feat, label, lengths)#

Transform function for the point cloud and features.

Parameters:

args – A list of tf Tensors.