The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.
in the medicaldetectiontoolkit/utils/model_utils.py, lines 883, batch_dice loss function,
I think should add
if y[:, 1:, ...].max() == 0:
y = 1 - y
pred = 1 - pred
for the patch if it has no roi.
in the medicaldetectiontoolkit/utils/model_utils.py, lines 883, batch_dice loss function, I think should add if y[:, 1:, ...].max() == 0: y = 1 - y pred = 1 - pred for the patch if it has no roi.