kitti
The KITTI 3D object detection protocol: per-class AP at the official IoU thresholds.
Functions:
-
kitti_average_precisionβThe KITTI 3D detection metrics: per-class AP at the official IoU thresholds, and their mean.
kitti_average_precision [source] ΒΆ
kitti_average_precision(
matches: Sequence[BoxMatches],
class_names: Sequence[str] = (
"Car",
"Pedestrian",
"Cyclist",
),
) -> Dict[str, float]
The KITTI 3D detection metrics: per-class AP at the official IoU thresholds, and their mean.
Each class is matched at its KITTI IoU threshold (Car at \(0.7\), Pedestrian and Cyclist at \(0.5\)), and AP interpolates precision at the 11 recall points \(0.0, 0.1, \ldots, 1.0\) of the KITTI benchmark. mAP averages the per-class APs.
Parameters:
-
matches(Sequence[BoxMatches]) βThe
box_matchesrecords of every evaluated scene, with labels indexingclass_names. -
class_names(Sequence[str], default:('Car', 'Pedestrian', 'Cyclist')) βClass name per label index, each one of
Car,PedestrianandCyclist.
Returns:
-
Dict[str, float]βAP/<class>for every class, andmAP.
Example
>>> import torch
>>> from torch_pointcloud.metrics import box_matches, kitti_average_precision
>>> zero = torch.tensor([0])
>>> boxes = torch.tensor([[0.0, 0.0, 0.0, 4.0, 2.0, 1.5, 0.0]])
>>> preds = {"boxes": boxes, "scores": torch.tensor([0.9]), "labels": zero, "batch": zero}
>>> target = {"boxes": boxes, "labels": zero, "batch": zero}
>>> metrics = kitti_average_precision([box_matches(preds, target)])
>>> sorted(metrics)
['AP/Car', 'AP/Cyclist', 'AP/Pedestrian', 'mAP']