From f226043d8a7ee4d513c60191f4b9d9320970c75b Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:46:11 +0800 Subject: [PATCH 1/2] fix #677 Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> --- models/vista2d/configs/metadata.json | 3 ++- models/vista2d/scripts/components.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/models/vista2d/configs/metadata.json b/models/vista2d/configs/metadata.json index 067b579a..a1cba412 100644 --- a/models/vista2d/configs/metadata.json +++ b/models/vista2d/configs/metadata.json @@ -1,7 +1,8 @@ { "schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20240725.json", - "version": "0.2.8", + "version": "0.2.9", "changelog": { + "0.2.9": "fix unsupported data dtype in findContours", "0.2.8": "remove relative path in readme", "0.2.7": "enhance readme", "0.2.6": "update tensorrt benchmark results", diff --git a/models/vista2d/scripts/components.py b/models/vista2d/scripts/components.py index 454356c0..c7ddd678 100644 --- a/models/vista2d/scripts/components.py +++ b/models/vista2d/scripts/components.py @@ -251,6 +251,7 @@ def __call__(self, data): cv2.imwrite(output_filepath, image) logger.info(f"Overlay Masks: Saving {output_filepath}") else: + label = cv2.convertScaleAbs(label, alpha=255.0/label.max()) contours, _ = cv2.findContours(label, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) polygons.extend(self.to_polygons(contours)) From 825c7c45d793b09f70396d9eb74fd66c763a3539 Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:53:35 +0800 Subject: [PATCH 2/2] fix format Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> --- models/vista2d/scripts/components.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/vista2d/scripts/components.py b/models/vista2d/scripts/components.py index c7ddd678..61b89c8d 100644 --- a/models/vista2d/scripts/components.py +++ b/models/vista2d/scripts/components.py @@ -251,7 +251,7 @@ def __call__(self, data): cv2.imwrite(output_filepath, image) logger.info(f"Overlay Masks: Saving {output_filepath}") else: - label = cv2.convertScaleAbs(label, alpha=255.0/label.max()) + label = cv2.convertScaleAbs(label, alpha=255.0 / label.max()) contours, _ = cv2.findContours(label, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) polygons.extend(self.to_polygons(contours))