lingvo.tasks.car.kitti_ap_metric module¶
Average Precision metric class for KITTI.
-
class
lingvo.tasks.car.kitti_ap_metric.KITTIAPMetrics(params)[source]¶ Bases:
lingvo.tasks.car.ap_metric.APMetricsThe KITTI implementation of AP metric.
-
_GetData(classid, difficulty=None, distance=None, num_points=None, rotation=None)[source]¶ Returns groundtruth and prediction for the classid in a NestedMap.
- Parameters
classid – int32 specifying the class
difficulty – String in [easy, moderate, hard]. If None specified, all difficulty levels are permitted.
distance – int32 specifying a binned Euclidean distance of the ground truth bounding box. If None is specified, all distances are selected.
num_points – int32 specifying a binned number of laser points within the ground truth bounding box. If None is specified, all boxes are selected.
rotation – int32 specifying a binned rotation within the ground truth bounding box. If None is specified, all boxes are selected.
- Returns
NestedMap containing iou_threshold, groundtruth and predictions for specified, classid, difficulty level and binned distance. If no bboxes are found with these parameters, returns None.
-
_BuildMetric(feed_data, classid)[source]¶ Construct tensors and the feed_dict for KITTI metric op.
- Parameters
feed_data – a NestedMap returned by _GetData()
classid – integer. Unused in this implementation.
- Returns
scalar_metrics: a dict mapping all the metric names to fetch tensors.
curves: a dict mapping all the curve names to fetch tensors.
feed_dict: a dict mapping the tensors in feed_tensors to feed values.
- Return type
A tuple of 3 dicts
-
_ComputeFinalMetrics(classids=None, difficulty=None, distance=None, num_points=None, rotation=None)[source]¶ Compute precision-recall curves as well as average precision.
- Parameters
classids – A list of N int32.
difficulty – String in [easy, moderate, hard]. If None specified, all difficulty levels are permitted.
distance – int32 specifying a binned Euclidean distance of the ground truth bounding box. If None is specified, all distances are selected.
num_points – int32 specifying a binned number of laser points within the ground truth bounding box. If None is specified, all boxes are selected.
rotation – int32 specifying a binned rotation within the ground truth bounding box. If None is specified, all boxes are selected.
- Returns
dict. Each entry in the dict is a list of C (number of classes) dicts containing mapping from metric names to individual results. Individual entries may be the following items. - scalars: A list of C (number of classes) dicts mapping metric names to scalar values. - curves: A list of C dicts mapping metrics names to np.float32 arrays of shape [NumberOfPrecisionRecallPoints()+1, 2]. In the last dimension, 0 indexes precision and 1 indexes recall. - calibrations: A list of C dicts mapping metrics names to np.float32 arrays of shape [number of predictions, 2]. The first column is the predicted probabilty and the second column is 0 or 1 indicating that the prediction matched a ground truth item.
-