def __init__( self, data: Union[List[Dict], str], grow_distance: int = 75, itc_diameter: int = 200, eval_thresholds: Tuple = (0.25, 0.5, 1, 2, 4, 8), nms_sigma: float = 0.0, nms_prob_threshold: float = 0.5, nms_box_size: int = 48, image_reader_name: str = "cuCIM", ) -> None: if isinstance(data, str): self.data = self._load_data(data) else: self.data = data self.grow_distance = grow_distance self.itc_diameter = itc_diameter self.eval_thresholds = eval_thresholds self.image_reader = WSIReader(image_reader_name) self.nms = PathologyProbNMS( sigma=nms_sigma, prob_threshold=nms_prob_threshold, box_size=nms_box_size, )
def test_output(self, class_args, call_args, probs_map, expected): nms = PathologyProbNMS(**class_args) output = nms(probs_map, **call_args) np.testing.assert_allclose(output, expected)