Closed
Description
While training an Inception Model with a mix of color and greyscale images I've noticed that some of the greyscale images were loosing most of the details when loading them with flow_from_directory
.
The cause is the RGB conversion from Pillow used in load_img
as described in this issue Pillow-2574
In my case the suggested workaround fixed the conversion.
This is the code I've used to handle the RGB conversion:
if img.mode != 'RGB':
if img.mode == 'I':
from PIL import ImageMath
img = ImageMath.eval('im/256', {'im': img})
img = img.convert('RGB')
Metadata
Metadata
Assignees
Labels
No labels