From b2158758b054ef177a2d3e7a94350d325d59e8df Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Wed, 2 Aug 2023 11:05:44 +0200
Subject: [PATCH] [data.padchest] Add more comments about labels in the various
 splits

---
 src/ptbench/data/padchest/datamodule.py  | 4 ++--
 src/ptbench/data/padchest/no_tb_idiap.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/ptbench/data/padchest/datamodule.py b/src/ptbench/data/padchest/datamodule.py
index 5db73888..5057d86f 100644
--- a/src/ptbench/data/padchest/datamodule.py
+++ b/src/ptbench/data/padchest/datamodule.py
@@ -36,7 +36,7 @@ class RawDataLoader(_BaseRawDataLoader):
         rc = load_rc()
         self.datadir = rc.get("datadir.padchest", os.path.realpath(os.curdir))
 
-    def sample(self, sample: tuple[str, list[int]]) -> Sample:
+    def sample(self, sample: tuple[str, int | list[int]]) -> Sample:
         """Loads a single image sample from the disk.
 
         Parameters
@@ -68,7 +68,7 @@ class RawDataLoader(_BaseRawDataLoader):
 
         return tensor, dict(label=sample[1], name=sample[0])  # type: ignore[arg-type]
 
-    def label(self, sample: tuple[str, list[int]]) -> list[int]:
+    def label(self, sample: tuple[str, int | list[int]]) -> int | list[int]:
         """Loads a single image sample label from the disk.
 
         Parameters
diff --git a/src/ptbench/data/padchest/no_tb_idiap.py b/src/ptbench/data/padchest/no_tb_idiap.py
index 62e4b56b..68f3e83b 100644
--- a/src/ptbench/data/padchest/no_tb_idiap.py
+++ b/src/ptbench/data/padchest/no_tb_idiap.py
@@ -13,7 +13,7 @@ datamodule = DataModule("no-tb-idiap.json.bz2")
 
 * Images path adapted to Idiap infrastructure
 
-* Labels (in order):
+* Labels (in order), match those of NIH CXR-14:
 
   * cardiomegaly
   * emphysema
-- 
GitLab