lingvo.tasks.car.point_detector module¶
Base models for point-cloud based detection.
-
class
lingvo.tasks.car.point_detector.PointDetectorBase(*args, **kwargs)[source]¶ Bases:
lingvo.core.base_model.BaseTaskBase class for implementing point-based detectors.
Subclasses should implement _BBoxesAndLogits() to compute the bounding box and scores given an input batch, and specify an appropriate decoder implementation.
-
_BBoxesAndLogits(input_batch, predictions)[source]¶ Fetch and return the bounding boxes and logits from an input.
- Parameters
input_batch – The input batch from which to produce boxes and logits.
predictions – The output dictionary of ComputePredictions.
- Returns
A .NestedMap containing
predicted_bboxes: A [batch_size, num_boxes, 7] floating point Tensor.
classification_logits: A [batch_size, num_boxes, num_classes] floating point Tensor.
-
_Placeholders()[source]¶ Return a NestedMap of placeholders to fill in for inference.
Runs the configured input pipeline to generate the expected shapes and types of the inputs.
- Returns
- A NestedMap of placeholders matching the input structure of
the inference model.
-
_BBoxDimensionErrors(gt_bboxes, pred_bboxes, regression_weights, epsilon=1e-06)[source]¶ Calculates the errors per bounding box dimension for assigned anchors.
- Parameters
gt_bboxes – float Tensor of shape […, 7] with the ground truth bounding box for each anchor.
pred_bboxes – float Tensor of shape […, 7] with the predicted bounding box for each anchor.
regression_weights – float Tensor with 0/1 weights indicating whether the anchor had a positive assignment with same base shape as
gt_bboxesandpred_bboxesexcluding the last dimension.epsilon – A float epsilon for the denominiator of our MaskedAverage.
- Returns
A metrics dict with mean bounding box errors for all positive assigned anchor locations.
-
Inference()[source]¶ Builds the inference graph.
Default subgraph should return:
predicted_bboxes: A [batch_size, num_boxes, 7] float Tensor.
classification_scores: A [batch_size, num_boxes, num_classes] float Tensor.
- Returns
A dictionary whose values are a tuple of fetches and feeds.
-
PostProcessDecodeOut(dec_out_dict, dec_metrics_dict)[source]¶ Post-processes decoder out and updates contents of
decode_metrics_dict.- Parameters
decode_out_dict – A dictionary of Tensors fetched.
decode_metrics_dict – A dict mapping from string key to
BaseMetricobject as created byCreateDecoderMetrics.
- Returns
output_key_value_pairs - a list of (key, value) pairs that can be saved (i.e. of type str, bytes, or unicode).
-