lingvo.tasks.car.detection_3d_metrics module¶
Metrics for 3D detection problems.
-
class
lingvo.tasks.car.detection_3d_metrics.TopDownVisualizationMetric(top_down_transform, class_id_to_name=None, image_height=1536, image_width=1024, figsize=None, ground_removal_threshold=- 1.35, sampler_num_samples=8)[source]¶ Bases:
lingvo.core.metrics.BaseMetricTop-down detection visualization, expecting 3D laser points and 2D bboxes.
- Updates to this metric is expected to be
NestedMapcontaining: visualization_labels: [N, B1] int tensor containing visualization labels.
predicted_bboxes: [N, B1, 5] float tensor containing predicted 2D bboxes each with (x, y, dx, dy, phi).
visualization_weights: [N, B1] float tensor containing weights for each prediction. predictions with 0 weight will not be drawn.
points_xyz: [N, P, 3] float tensor containing (x, y, z) coordinates.
points_padding: [N, P] tensor containing 1 if the point is a padded point.
gt_bboxes_2d: [N, B2, 5] float tensor containing ground-truth 2D bboxes.
gt_bboxes_2d_weights: [N, B2] float tensor containing weights for each ground-truth. predictions with 0 weight will not be drawn. The ground-truth mask can be used here.
labels: [N, B2] int tensor containing ground-truth labels.
difficulties: [N, B2]: int tensor containing the difficulty levels of each groundtruth box.
Default parameters visualize the area around the car, with the car centered in the image, over a 32m x 48m range.
Ground-truth boxes will be drawn with color=cyan (see DrawBBoxesOnImages for details). Predicted boxes will be drawn with a color from the PIL color list, with a different color per class.
-
Update(decoded_outputs)[source]¶ Add top down visualization to summaries.
- Parameters
decoded_outputs – A
NestedMapcontaining the fields visualization_labels, predicted_bboxes, visualization_weights, points_xyz, points_padding, gt_bboxes_2d, gt_bboxes_2d_weights, and labels.
- Updates to this metric is expected to be
-
class
lingvo.tasks.car.detection_3d_metrics.WorldViewer(sampler_num_samples=8)[source]¶ Bases:
lingvo.core.metrics.BaseMetricWorld Viewer for 3d point cloud scenes.
-
_MAX_HUE= 0.65¶
-
_MAX_DISTANCE_METERS= 40.0¶
-
Update(decoded_outputs)[source]¶ Add point cloud mesh data to be summarized.
- Parameters
decoded_outputs – A
NestedMapcontaining the fields visualization_labels, predicted_bboxes, visualization_weights, points_xyz, points_padding, gt_bboxes_2d, gt_bboxes_2d_weights, and labels.
-
-
class
lingvo.tasks.car.detection_3d_metrics.CameraVisualization(figsize=(15, 15), bbox_score_threshold=0.01, sampler_num_samples=8, draw_3d_boxes=True)[source]¶ Bases:
lingvo.core.metrics.BaseMetricCamera detection visualization.
Visualizes a camera image and predicted bounding boxes on top of the image.
Updates to this metric is expected to be
NestedMapcontaining:camera_images: [N, W, H, 3] float tensor containing camera image data.
bbox_corners: [N, B1, 8, 2] float tensor containing bounding box corners. For each batch (N), for each box B, there are 8 corners, each with an X and Y value.
bbox_scores: [N, B1] float tensor containing predicted box scores.
-
Update(decoded_outputs)[source]¶ Updates this metric (e.g. accumulates statistics) from the arguments.
-