Replies: 1 comment 2 replies
-
Hi @rhhdgt, thanks for your interest here. A possible solution maybe you can add some blank images during training. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have run the tutorial code for a 2d unet, line for line:
https://github.com/Project-MONAI/tutorials/blob/main/2d_segmentation/torch/unet_training_dict.py
It works well at segmenting the example circles binary images.
However, if you just give it a blank image (ie all zeros -- see code snippet below), it produces odd results. This is the segmentation that it produces:
I've never seen this behaviour in other CNN libraries. Does anyone know what's going on?
The code to produce the above image is:
import matplotlib.pyplot as plt val_data=monai.utils.misc.first(val_loader) val_images, _ = val_data["img"].to(device), val_data["seg"].to(device) val_images = val_images * 0 roi_size = (96, 96) sw_batch_size = 4 val_outputs = sliding_window_inference(val_images, roi_size, sw_batch_size, model) val_outputs = [post_trans(i) for i in decollate_batch(val_outputs)] plt.imshow(val_outputs[0][0].cpu().detach().numpy());
Beta Was this translation helpful? Give feedback.
All reactions