coco_tensor_list_to_dict_list#
- ignite.metrics.vision.object_detection_average_precision_recall.coco_tensor_list_to_dict_list(output)[source]#
Convert either of output’s y_pred or y from list of (N, 6) tensors to list of str-to-tensor dictionaries, or keep them unchanged if they’re already in the deisred format.
Input format is a (N, 6) or (N, 5) tensor which N is the number of predicted/target bounding boxes for the image and the second dimension contains (x1, y1, x2, y2, confidence, class)/(x1, y1, x2, y2, class[, iscrowd]). Output format is a str-to-tensor dictionary containing ‘bbox’ and class keys, plus confidence key for y_pred and possibly iscrowd (dtype: torch.bool) for y.
- Parameters:
output (tuple[list[torch.Tensor] | list[dict[str, torch.Tensor]], list[torch.Tensor] | list[dict[str, torch.Tensor]]]) – (y_pred,y) tuple whose members are either list of tensors or list of dicts.
- Returns:
(y_pred,y) tuple whose members are list of str-to-tensor dictionaries.
- Return type:
tuple[list[dict[str, torch.Tensor]], list[dict[str, torch.Tensor]]]