sydney0zq / covid-19-detection

The implementation of "A Weakly-supervised Framework for COVID-19 Classification and Lesion Localization from Chest CT"
110 stars 34 forks source link

Image has wrong mode in dataste_ops.py using deCoVnet #3

Closed bartmch closed 4 years ago

bartmch commented 4 years ago

Hi, while train.py from deCoVnet I'm getting an error from dataset_ops.py at line 108 # Color Transforms def colorop(img, bright, contrast): _img = TF.adjust_brightness(img, bright) _img = TF.adjust_contrast(_img, contrast) return _img the error is saying

ValueError: image has wrong mode

Image is a PIL image and bright is a float image

bartmch commented 4 years ago

TF.adjust_brightness(img.convert('L'), bright) seems to work. Can you confirm this doesn't break the image?

sydney0zq commented 4 years ago

@bartmch Sorry for the late reply. Please check the shape of img, it should be in HxWxC and the datatype of it should be 'uint8', otherwise the error will prompt. I think maybe you input a 16bit image into this function.