Skip to content
Snippets Groups Projects
Commit 452a7b4d authored by André Anjos's avatar André Anjos :speech_balloon: Committed by Daniel CARRON
Browse files

[config.data.nih_cxr14.datamodule] Fix loading of RGBA-encoded images (closes #51)

parent 85e82c3d
No related branches found
No related tags found
1 merge request!12Adds grad-cam support on classifiers
...@@ -89,8 +89,10 @@ class RawDataLoader(_BaseRawDataLoader): ...@@ -89,8 +89,10 @@ class RawDataLoader(_BaseRawDataLoader):
basename, basename,
) )
# N.B.: NIH CXR-14 images are encoded as color PNGs # N.B.: some NIH CXR-14 images are encoded as color PNGs with an alpha
# channel. Most, are grayscale PNGs
image = PIL.Image.open(os.path.join(self.datadir, file_path)) image = PIL.Image.open(os.path.join(self.datadir, file_path))
image = image.convert("L") # required for some images
tensor = to_tensor(image) tensor = to_tensor(image)
# use the code below to view generated images # use the code below to view generated images
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment