cloudViewer.ml.torch.models.PointPillars#
- class cloudViewer.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)[source]#
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)[source]#
Initialize.
- forward(inputs)[source]#
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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- get_optimizer(cfg)[source]#
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)[source]#
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.
- loss(results, inputs)[source]#
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.
- preprocess(data, attr)[source]#
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