open3d.ml.torch.models.PointPillars#
- class open3d.ml.torch.models.PointPillars(name='PointPillars', device='cuda', point_cloud_range=[0, -40.0, -3, 70.0, 40.0, 1], classes=['car'], voxelize={}, voxel_encoder={}, scatter={}, backbone={}, neck={}, head={}, loss={}, **kwargs)#
Object detection model. Based on the PointPillars architecture https://github.com/nutonomy/second.pytorch.
- Parameters:
name (string) – Name of model. Default to “PointPillars”.
voxel_size – voxel edge lengths with format [x, y, z].
point_cloud_range – The valid range of point coordinates as [x_min, y_min, z_min, x_max, y_max, z_max].
voxelize – Config of PointPillarsVoxelization module.
voxelize_encoder – Config of PillarFeatureNet module.
scatter – Config of PointPillarsScatter module.
backbone – Config of backbone module (SECOND).
neck – Config of neck module (SECONDFPN).
head – Config of anchor head module.
- __init__(name='PointPillars', device='cuda', point_cloud_range=[0, -40.0, -3, 70.0, 40.0, 1], classes=['car'], voxelize={}, voxel_encoder={}, scatter={}, backbone={}, neck={}, head={}, loss={}, **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
- extract_feats(points)#
Extract features from points.
- forward(inputs)#
Defines 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(results, inputs)#
Computes the loss given the network input and outputs.
- Parameters:
Loss – A loss object.
results – This is the output of the model.
inputs – This is the input to the model.
- Returns:
Returns the loss value.
- get_optimizer(cfg)#
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_end(results, inputs)#
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.
- 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)#
Transform function for the point cloud and features.
- Parameters:
cfg_pipeline – config file for pipeline.
- voxelize(points)#
Apply hard voxelization to points.
- training: bool#