def METHOD_NAME(self, detected, ground_truth):
    """Group gts and dts on a imageXclass basis."""
    # Calculating pairwise IoUs on classes
    bb_info = self.group_class_detection_label(detected, ground_truth)
    ious = {k: self.calc_pairwise_ious(v["detected"], v["ground_truth"]) for k, v in bb_info.items()}
    for class_id in ious.keys():
        tp, fp, fn = self._evaluate_image(
            np.array(self.get_confidences(bb_info[class_id]["detected"])),
            bb_info[class_id]["ground_truth"],
            ious[class_id]
        )
        acc = self._evals[class_id]
        acc["tp"] += tp
        acc["fp"] += fp
        acc["fn"] += fn