Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mednet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
medai
software
mednet
Commits
452a7b4d
Commit
452a7b4d
authored
1 year ago
by
André Anjos
Committed by
Daniel CARRON
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[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
!12
Adds grad-cam support on classifiers
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ptbench/config/data/nih_cxr14/datamodule.py
+3
-1
3 additions, 1 deletion
src/ptbench/config/data/nih_cxr14/datamodule.py
with
3 additions
and
1 deletion
src/ptbench/config/data/nih_cxr14/datamodule.py
+
3
−
1
View file @
452a7b4d
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment