open3d.ml.tf.models.PVCNN#
- class open3d.ml.tf.models.PVCNN(*args, **kwargs)#
Semantic Segmentation model. Based on Point Voxel Convolutions. https://arxiv.org/abs/1907.03739
Uses PointNet architecture with separate Point and Voxel processing.
- name#
Name of model. Default to “PVCNN”.
- num_classes#
Number of classes.
- num_points#
Number of points to sample per pointcloud.
- extra_feature_channels#
Number of extra features. Default to 6 (RGB + Coordinate norms).
- batcher#
Batching method for dataloader.
- augment#
dictionary for augmentation.
- __init__(name='PVCNN', device='cuda', num_classes=13, num_points=40960, extra_feature_channels=6, width_multiplier=1, voxel_resolution_multiplier=1, batcher='DefaultBatcher', augment=None, **kwargs)#
- call(inputs, training=False)#
Forward pass for the model.
- Parameters:
inputs – A dict object for inputs with following keys
point (tf.float32) – Input pointcloud (B, N,3)
feat (tf.float32) – Input features (B, N, 9)
training (bool) – Whether model is in training phase.
- Returns:
probability distribution (B, N, C).
- Return type:
tf.float32
- get_batch_gen(dataset, steps_per_epoch=None, batch_size=1)#
- get_loss(sem_seg_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(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. It consists of subsampling and normalizing the pointcloud and creating new features.
- Parameters:
data – A sample from the dataset.
attr – The corresponding attributes.
- Returns:
Returns the preprocessed data
- transform(points, feat, labels)#
Transform function for the point cloud and features.
This function is called after preprocess method by dataset generator. It consists of mapping data to dict.
- Parameters:
points – Input pointcloud.
feat – Input features.
labels – Input labels.
- Returns:
Returns dictionary data with keys (point, feat, label).
- blocks = ((64, 1, 32), (64, 2, 16), (128, 1, 16), (1024, 1, None))#