discopat.nn_training.evaluation.matching
Functions
|
Compute pairwise Euclidean distance between box centers. |
|
Compute IoMean matrix between predicted and GT boxes (both [N, 4] arrays in xyxy format). |
|
Compute IoU matrix between predicted and GT boxes (both [N, 4] arrays in xyxy format). |
Match GTs and predictions on an image in the dataset. |
|
|
Cast to numpy array. |
- discopat.nn_training.evaluation.matching.compute_center_distance_matrix(groundtruths, predictions)[source]
Compute pairwise Euclidean distance between box centers.
- Parameters:
groundtruths (array) – (N_gt, 4)
predictions (array) – (N_pred, 4)
- Returns:
(N_pred, N_gt) matrix of pairwise center distances.
- Return type:
array
- discopat.nn_training.evaluation.matching.compute_iomean_matrix(groundtruths, predictions)[source]
Compute IoMean matrix between predicted and GT boxes (both [N, 4] arrays in xyxy format).
- Parameters:
groundtruths (array) – (N_gt, 4)
predictions (array) – (N_pred, 4)
- Returns:
(N_pred, N_gt) matrix of pairwise IoUs
- Return type:
array
- discopat.nn_training.evaluation.matching.compute_iou_matrix(groundtruths, predictions)[source]
Compute IoU matrix between predicted and GT boxes (both [N, 4] arrays in xyxy format).
- Parameters:
groundtruths (array) – (N_gt, 4)
predictions (array) – (N_pred, 4)
- Returns:
(N_pred, N_gt) matrix of pairwise IoUs
- Return type:
array
- discopat.nn_training.evaluation.matching.match_groundtruths_and_predictions(groundtruths, predictions, scores, localization_criterion)[source]
Match GTs and predictions on an image in the dataset.
- Parameters:
groundtruths (list) – list of groundtruths, boxes [x1, y1, x2, y2],
predictions (list) – list of predictions, boxes [x1, y1, x2, y2],
scores (list) – list of confidence score, same length as predictions
localization_criterion (str) – metric used to assess the fit between GTs and predictions.
- Returns:
The total number of groundtruths,
For each pred, a tuple (score, is_tp).
- Return type:
A report for the considered image, containing