Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unsupported data dtype for FindContours in vista2d #678

Merged
merged 4 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion models/vista2d/configs/metadata.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions models/vista2d/scripts/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
Loading