lingvo.tasks.car.pillars module¶
PointPillars implementation.
[1] PointPillars. https://arxiv.org/abs/1812.05784
-
lingvo.tasks.car.pillars.SparseToDense(grid_shape, locations, feats)[source]¶ Converts a sparse representation back to the dense grid.
- Parameters
grid_shape – (nx, ny, nz). The shape of the grid.
locations – [b, p, 3]. Locations of the pillars.
feats – [b, p, fdims]. Extracted features for pillars.
- Returns
grid_feats of shape [b, nx, ny, nz * fdims].
-
class
lingvo.tasks.car.pillars.PointsToGridFeaturizer(*args, **kwargs)[source]¶ Bases:
lingvo.core.base_layer.BaseLayerLayer for processing points to grid outputs.
-
FProp(theta, input_batch)[source]¶ Compute features for the pillars and convert them back to a dense grid.
- Parameters
theta – A
NestedMapobject containing variable values of this task.input_batch –
A
NestedMapobject containing input tensors. Following keys are required:grid_num_points: Integer tensor with shape [batch size, nx, ny, nz], where nx, ny, nz corresponds to the grid sizes (i.e., number of voxels in each axis dimension).
pillar_points: Float tensor with shape [batch size, num_pillars, num_points_per_pillar, 3 + num_laser_features]
pillar_centers: Float tensor with shape [batch size, num_pillars, num_points_per_pillar, 3]
pillar_locations: Float tensor with shape [batch size, num_pillars, 3]
- Returns
The dense features with shape [b, nx, ny, nz * fdims].
-
-
class
lingvo.tasks.car.pillars.Builder[source]¶ Bases:
lingvo.tasks.car.builder_lib.ModelBuilderBaseBuilder for the Pillars model.
-
class
lingvo.tasks.car.pillars.LossNormType(value)[source]¶ Bases:
enum.EnumAn enumeration.
-
NO_NORM= 0¶
-
NORM_BY_NUM_POSITIVES= 1¶
-
-
class
lingvo.tasks.car.pillars.ModelV1(*args, **kwargs)[source]¶ Bases:
lingvo.tasks.car.point_detector.PointDetectorBasePointPillars model.
Base class implements common Decoder functions, though they can be overridden if desired.
-
NUM_OUTPUT_CHANNELS= 128¶
-
classmethod
Params(grid_size_z=1, num_anchors=2, num_classes=1, num_laser_features=1)[source]¶ Returns the layer params.
-
_ComputeClassificationLoss(predictions, input_batch, class_weights)[source]¶ Compute classification loss for the given predictions.
- Parameters
predictions – The output of
ComputePredictions, contains: logits - [b, nx, ny, nz, na, 7 + num_classes]. na is the number of anchor boxes per cell. […, :7] are (dx, dy, dz, dw, dl, dh, dt).input_batch – The input batch from which we accesses the groundtruth.
class_weights – Per-class weights to use in loss computation.
- Returns
Classification loss.
-
ComputeLoss(theta, predictions, input_batch)[source]¶ Computes loss and other metrics for the given predictions.
- Parameters
theta – A
NestedMapobject containing variable values of this task.predictions – The output of
ComputePredictions, contains: logits - [b, nx, ny, nz, na, 7 + num_classes]. na is the number of anchor boxes per cell. […, :7] are (dx, dy, dz, dw, dl, dh, dt).input_batch – The input batch from which we accesses the groundtruth.
- Returns
Two dicts defined as BaseTask.ComputeLoss.
-