super-gradients
super-gradients copied to clipboard
Bad support on some medical images with non RGB format
🐛 Describe the bug
Using this code with the latest version
for image in tqdm(images):
images_predictions = model.predict(image, iou=0.5, conf=0.4, class_agnostic_nms=True)
class_names = images_predictions.class_names
labels = images_predictions.prediction.labels
confidence = images_predictions.prediction.confidence
bboxes = images_predictions.prediction.bboxes_xyxy
basefile = os.path.basename(image)
for i, (label, conf, bbox) in enumerate(zip(labels, confidence, bboxes)):
predictions.append({
'xmin': int(bbox[0]),
'ymin': int(bbox[1]),
'xmax': int(bbox[2]),
'ymax': int(bbox[3]),
'confidence': float(conf),
'class': int(label),
'name': class_names[int(label)],
'filename': basefile
})
and noticed that my metrics are way off. Turns out, it reads the images that are mode I when using Pillow on image.mode weirdly and has poor support on this. Image gets loaded like this
Versions
Latest
What is the original image format and channel number and depth?
If you open it via Image.open, the mode is I instead of RGB
What is the original image format and channel number and depth? Can you attach a file?
alerady mentioned it before but in case its not clear