From ab69fcc69c6e3b3c4428d01eb8f0fd42adb7b8c7 Mon Sep 17 00:00:00 2001 From: Nicolas Kaenzig Date: Fri, 29 Nov 2024 13:39:06 +0100 Subject: [PATCH] updated yaml configs --- configs/vision/pathology/offline/segmentation/bcss.yaml | 5 +++-- configs/vision/pathology/offline/segmentation/consep.yaml | 5 +++-- configs/vision/pathology/offline/segmentation/monusac.yaml | 5 +++-- configs/vision/pathology/online/segmentation/bcss.yaml | 5 +++-- configs/vision/pathology/online/segmentation/consep.yaml | 5 +++-- configs/vision/pathology/online/segmentation/monusac.yaml | 5 +++-- configs/vision/radiology/offline/segmentation/lits.yaml | 5 +++-- .../vision/radiology/offline/segmentation/lits_balanced.yaml | 5 +++-- .../radiology/offline/segmentation/total_segmentator_2d.yaml | 5 +++-- configs/vision/radiology/online/segmentation/lits.yaml | 5 +++-- .../vision/radiology/online/segmentation/lits_balanced.yaml | 5 +++-- .../radiology/online/segmentation/total_segmentator_2d.yaml | 5 +++-- src/eva/vision/metrics/__init__.py | 4 +++- 13 files changed, 39 insertions(+), 25 deletions(-) diff --git a/configs/vision/pathology/offline/segmentation/bcss.yaml b/configs/vision/pathology/offline/segmentation/bcss.yaml index f81126d3..0b55fe2b 100644 --- a/configs/vision/pathology/offline/segmentation/bcss.yaml +++ b/configs/vision/pathology/offline/segmentation/bcss.yaml @@ -86,10 +86,11 @@ model: - class_path: torchmetrics.ClasswiseWrapper init_args: metric: - class_path: eva.vision.metrics.DiceScore + class_path: eva.vision.metrics.MonaiDiceScore init_args: + include_background: true num_classes: *NUM_CLASSES - average: none + reduction: none labels: - outside_roi - tumor diff --git a/configs/vision/pathology/offline/segmentation/consep.yaml b/configs/vision/pathology/offline/segmentation/consep.yaml index 5df1c7ff..300baff0 100644 --- a/configs/vision/pathology/offline/segmentation/consep.yaml +++ b/configs/vision/pathology/offline/segmentation/consep.yaml @@ -86,10 +86,11 @@ model: - class_path: torchmetrics.ClasswiseWrapper init_args: metric: - class_path: eva.vision.metrics.DiceScore + class_path: eva.vision.metrics.MonaiDiceScore init_args: + include_background: true num_classes: *NUM_CLASSES - average: none + reduction: none labels: - background - other diff --git a/configs/vision/pathology/offline/segmentation/monusac.yaml b/configs/vision/pathology/offline/segmentation/monusac.yaml index de101be6..65a2b8b0 100644 --- a/configs/vision/pathology/offline/segmentation/monusac.yaml +++ b/configs/vision/pathology/offline/segmentation/monusac.yaml @@ -89,10 +89,11 @@ model: - class_path: torchmetrics.ClasswiseWrapper init_args: metric: - class_path: eva.vision.metrics.DiceScore + class_path: eva.vision.metrics.MonaiDiceScore init_args: + include_background: true num_classes: 6 - average: none + reduction: none ignore_index: *IGNORE_INDEX labels: - background diff --git a/configs/vision/pathology/online/segmentation/bcss.yaml b/configs/vision/pathology/online/segmentation/bcss.yaml index 22d43b79..89243ea6 100644 --- a/configs/vision/pathology/online/segmentation/bcss.yaml +++ b/configs/vision/pathology/online/segmentation/bcss.yaml @@ -79,10 +79,11 @@ model: - class_path: torchmetrics.ClasswiseWrapper init_args: metric: - class_path: eva.vision.metrics.DiceScore + class_path: eva.vision.metrics.MonaiDiceScore init_args: + include_background: true num_classes: *NUM_CLASSES - average: none + reduction: none labels: - outside_roi - tumor diff --git a/configs/vision/pathology/online/segmentation/consep.yaml b/configs/vision/pathology/online/segmentation/consep.yaml index 9ec92cd7..a9605749 100644 --- a/configs/vision/pathology/online/segmentation/consep.yaml +++ b/configs/vision/pathology/online/segmentation/consep.yaml @@ -79,10 +79,11 @@ model: - class_path: torchmetrics.ClasswiseWrapper init_args: metric: - class_path: eva.vision.metrics.DiceScore + class_path: eva.vision.metrics.MonaiDiceScore init_args: + include_background: true num_classes: *NUM_CLASSES - average: none + reduction: none labels: - background - other diff --git a/configs/vision/pathology/online/segmentation/monusac.yaml b/configs/vision/pathology/online/segmentation/monusac.yaml index 3f11ac81..f512411c 100644 --- a/configs/vision/pathology/online/segmentation/monusac.yaml +++ b/configs/vision/pathology/online/segmentation/monusac.yaml @@ -81,10 +81,11 @@ model: - class_path: torchmetrics.ClasswiseWrapper init_args: metric: - class_path: eva.vision.metrics.DiceScore + class_path: eva.vision.metrics.MonaiDiceScore init_args: + include_background: true num_classes: 6 - average: none + reduction: none ignore_index: *IGNORE_INDEX labels: - background diff --git a/configs/vision/radiology/offline/segmentation/lits.yaml b/configs/vision/radiology/offline/segmentation/lits.yaml index 44cf2486..eaf8a83f 100644 --- a/configs/vision/radiology/offline/segmentation/lits.yaml +++ b/configs/vision/radiology/offline/segmentation/lits.yaml @@ -84,10 +84,11 @@ model: - class_path: torchmetrics.ClasswiseWrapper init_args: metric: - class_path: eva.vision.metrics.DiceScore + class_path: eva.vision.metrics.MonaiDiceScore init_args: + include_background: true num_classes: *NUM_CLASSES - average: none + reduction: none labels: - background - liver diff --git a/configs/vision/radiology/offline/segmentation/lits_balanced.yaml b/configs/vision/radiology/offline/segmentation/lits_balanced.yaml index c2475a49..8ce4e384 100644 --- a/configs/vision/radiology/offline/segmentation/lits_balanced.yaml +++ b/configs/vision/radiology/offline/segmentation/lits_balanced.yaml @@ -84,10 +84,11 @@ model: - class_path: torchmetrics.ClasswiseWrapper init_args: metric: - class_path: eva.vision.metrics.DiceScore + class_path: eva.vision.metrics.MonaiDiceScore init_args: + include_background: true num_classes: *NUM_CLASSES - average: none + reduction: none labels: - background - liver diff --git a/configs/vision/radiology/offline/segmentation/total_segmentator_2d.yaml b/configs/vision/radiology/offline/segmentation/total_segmentator_2d.yaml index 79640b0e..7f06bcb9 100644 --- a/configs/vision/radiology/offline/segmentation/total_segmentator_2d.yaml +++ b/configs/vision/radiology/offline/segmentation/total_segmentator_2d.yaml @@ -85,10 +85,11 @@ model: - class_path: torchmetrics.ClasswiseWrapper init_args: metric: - class_path: eva.vision.metrics.DiceScore + class_path: eva.vision.metrics.MonaiDiceScore init_args: + include_background: true num_classes: *NUM_CLASSES - average: none + reduction: none data: class_path: eva.DataModule init_args: diff --git a/configs/vision/radiology/online/segmentation/lits.yaml b/configs/vision/radiology/online/segmentation/lits.yaml index c3ee1c11..0912ea13 100644 --- a/configs/vision/radiology/online/segmentation/lits.yaml +++ b/configs/vision/radiology/online/segmentation/lits.yaml @@ -77,10 +77,11 @@ model: - class_path: torchmetrics.ClasswiseWrapper init_args: metric: - class_path: eva.vision.metrics.DiceScore + class_path: eva.vision.metrics.MonaiDiceScore init_args: + include_background: true num_classes: *NUM_CLASSES - average: none + reduction: none labels: - background - liver diff --git a/configs/vision/radiology/online/segmentation/lits_balanced.yaml b/configs/vision/radiology/online/segmentation/lits_balanced.yaml index 62a4fbcd..dd64f7cf 100644 --- a/configs/vision/radiology/online/segmentation/lits_balanced.yaml +++ b/configs/vision/radiology/online/segmentation/lits_balanced.yaml @@ -77,10 +77,11 @@ model: - class_path: torchmetrics.ClasswiseWrapper init_args: metric: - class_path: eva.vision.metrics.DiceScore + class_path: eva.vision.metrics.MonaiDiceScore init_args: + include_background: true num_classes: *NUM_CLASSES - average: none + reduction: none labels: - background - liver diff --git a/configs/vision/radiology/online/segmentation/total_segmentator_2d.yaml b/configs/vision/radiology/online/segmentation/total_segmentator_2d.yaml index 7ecfe7b0..651944eb 100644 --- a/configs/vision/radiology/online/segmentation/total_segmentator_2d.yaml +++ b/configs/vision/radiology/online/segmentation/total_segmentator_2d.yaml @@ -78,10 +78,11 @@ model: - class_path: torchmetrics.ClasswiseWrapper init_args: metric: - class_path: eva.vision.metrics.DiceScore + class_path: eva.vision.metrics.MonaiDiceScore init_args: + include_background: true num_classes: *NUM_CLASSES - average: none + reduction: none data: class_path: eva.DataModule init_args: diff --git a/src/eva/vision/metrics/__init__.py b/src/eva/vision/metrics/__init__.py index 1e4112b4..6149c898 100644 --- a/src/eva/vision/metrics/__init__.py +++ b/src/eva/vision/metrics/__init__.py @@ -4,10 +4,12 @@ from eva.vision.metrics.segmentation.dice import DiceScore from eva.vision.metrics.segmentation.generalized_dice import GeneralizedDiceScore from eva.vision.metrics.segmentation.mean_iou import MeanIoU +from eva.vision.metrics.segmentation.monai_dice import MonaiDiceScore __all__ = [ "DiceScore", "GeneralizedDiceScore", - "MulticlassSegmentationMetrics", "MeanIoU", + "MonaiDiceScore", + "MulticlassSegmentationMetrics", ]