Shortcuts

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 for y.

Parameters

output (Tuple[Union[List[Tensor], List[Dict[str, Tensor]]], Union[List[Tensor], List[Dict[str, 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, Tensor]], List[Dict[str, Tensor]]]