Compute the oracle performance for instance segmentation. This is a proxy for the highest achievable performance with the cluster partition at hand. More precisely, for the oracle prediction: - each cluster is assigned to the instance it shares the most
(
self,
num_classes: int,
**metric_kwargs
)
| 734 | return oracle_scores, oracle_y, oracle |
| 735 | |
| 736 | def instance_segmentation_oracle( |
| 737 | self, |
| 738 | num_classes: int, |
| 739 | **metric_kwargs |
| 740 | ) -> 'InstanceMetricResults': |
| 741 | """Compute the oracle performance for instance segmentation. |
| 742 | This is a proxy for the highest achievable performance with the |
| 743 | cluster partition at hand. |
| 744 | |
| 745 | More precisely, for the oracle prediction: |
| 746 | - each cluster is assigned to the instance it shares the most |
| 747 | points with |
| 748 | - clusters assigned to the same instance are merged into a |
| 749 | single prediction |
| 750 | - each predicted instance has a score equal to its IoU with |
| 751 | the assigned target instance |
| 752 | |
| 753 | :param num_classes: int |
| 754 | Number of valid classes. By convention, we assume |
| 755 | `y ∈ [0, num_classes-1]` are VALID LABELS, while |
| 756 | `y < 0` AND `y >= num_classes` ARE VOID LABELS |
| 757 | :param metric_kwargs: |
| 758 | Kwargs for the metrics computation |
| 759 | |
| 760 | :return: InstanceMetricResults |
| 761 | """ |
| 762 | # Compute oracle predictions |
| 763 | oracle_scores, oracle_y, oracle = self.oracle(num_classes) |
| 764 | |
| 765 | # Performance evaluation |
| 766 | from src.metrics import MeanAveragePrecision3D |
| 767 | metric = MeanAveragePrecision3D(num_classes, **metric_kwargs) |
| 768 | metric.update(oracle_scores, oracle_y, oracle) |
| 769 | results = metric.compute() |
| 770 | |
| 771 | return results |
| 772 | |
| 773 | def panoptic_segmentation_oracle( |
| 774 | self, |