kaggle_ndsb2017
kaggle_ndsb2017 copied to clipboard
One question about helpers.py
Hi Julian,
Your work is amazing and thanks so much for sharing.
For learning purpose, I am reading your code line by line. Can I ask you one quick and simple question? In helper.py, why you use number 127 and 255? Please see the code for reference below. Thanks so much!!!!
def compute_dice(label_img, pred_img, p_threshold=0.5): p = pred_img.astype(numpy.float) l = label_img.astype(numpy.float) if p.max() > 127: p /= 255. if l.max() > 127: l /= 255.
Hello Thanks, Just my laziness. Usually images have a value range from 0-255 and I sometimes just use 0-255 as train target. But for Dice you need range 0-1. It's just input sanitization.
Many thanks Julian! Happy new year!