Possible overlay bug with binary segmentation masks
See original GitHub issue-
Weights and Biases version: wandb, version 0.8.32
-
Python version: Python 3.6.8
-
Operating System: Linux
Description
Semantic Segmentation usecase for binary image masks feature for 3D volumes in grayscale
What I Did
Here’s the code to reproduce:
Malfunctioning code: The dashboard shows overlays only for class with label 0.
import numpy as np
import wandb
wandb.init(project='prototyping', entity='maastro-clinic')
target = np.random.randint(2, size=(32, 256, 256)).astype(np.uint8)
output = np.random.randint(2, size=(32, 256, 256)).astype(np.uint8)
data = np.random.randint(256, size=(32, 256, 256)).astype(np.uint8)
images = []
idx = 0
class_labels = {
0: 'background',
1: "nodule"
}
for im, t, o in zip(data, target, output):
idx += 1
images.append(wandb.Image(im, masks={"predictions": {"mask_data": o, "class_labels": class_labels}, \
"ground_truth": {"mask_data": t, "class_labels": class_labels}}, caption='CT'))
wandb.log({"Predictions": images})
Changing the masks to have values from 0 to 2 and adding a class label makes all the 3 overlays work fine.
import numpy as np
import wandb
wandb.init(project='prototyping', entity='maastro-clinic')
target = np.random.randint(3, size=(32, 256, 256)).astype(np.uint8)
output = np.random.randint(3, size=(32, 256, 256)).astype(np.uint8)
data = np.random.randint(256, size=(32, 256, 256)).astype(np.uint8)
images = []
idx = 0
class_labels = {
0: 'background',
1: "nodule",
2: "nodule2"
}
for im, t, o in zip(data, target, output):
idx += 1
images.append(wandb.Image(im, masks={"predictions": {"mask_data": o, "class_labels": class_labels}, \
"ground_truth": {"mask_data": t, "class_labels": class_labels}}, caption='CT'))
wandb.log({"Predictions": images})
Am I missing something here?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Image Sequence Display and Overlay with Binary Mask
The GUI will help to display single or multiple images in a single window overlaying with binary masks. Very useful for displaying segmented ......
Read more >How to overlay segmented image on top of main image in ...
I had a go at this using four different methods: OpenCV; PIL/Pillow and Numpy; command-line with ImageMagick; morphology from skimage ...
Read more >Paint ground-truth mask on image (without training a classifier)
Hi all, In order to evaluate the quality of an automated segmentation, I am looking for a way to generate a manual segmentation...
Read more >Script to overlay binary segmentation masks over the image. If ...
Script to overlay binary segmentation masks over the image. If masks are overlaying, they colors will blend. Prepare the list of boolean masks,...
Read more >An overview of semantic image segmentation. - Jeremy Jordan
When we overlay a single channel of our target (or prediction), we refer to this as a mask which illuminates the regions of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @surajpaib thanks for reporting these bugs. I want to get both of these fixed for you.
I’ve got a PR up to fix the binary image masks issue #985. I’m looking at the other issue and I’ll get a fix out this week.
@surajpaib I’m going to close this issue. Feel free to open a new ticket if you find the other issue causing problems.