tumourkit.segmentation.hovernet.metrics.stats_utils.get_fast_pq
- tumourkit.segmentation.hovernet.metrics.stats_utils.get_fast_pq(true, pred, match_iou=0.5)
match_iou is the IoU threshold level to determine the pairing between GT instances p and prediction instances g. p and g is a pair if IoU > match_iou. However, pair of p and g must be unique (1 prediction instance to 1 GT instance mapping).
If match_iou < 0.5, Munkres assignment (solving minimum weight matching in bipartite graphs) is caculated to find the maximal amount of unique pairing.
If match_iou >= 0.5, all IoU(p,g) > 0.5 pairing is proven to be unique and the number of pairs is also maximal.
Fast computation requires instance IDs are in contiguous orderding i.e [1, 2, 3, 4] not [2, 3, 6, 10]. Please call remap_label beforehand and by_size flag has no effect on the result.
- Returns:
[dq, sq, pq]: measurement statistic
- [paired_true, paired_pred, unpaired_true, unpaired_pred]:
pairing information to perform measurement