From cb8c87bbb996465c5e9c6266a0b9d1ad49d2b2c1 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Wed, 2 Aug 2023 13:25:10 +0200
Subject: [PATCH] [data.padchest] Fix normalizer

---
 src/ptbench/data/padchest/datamodule.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ptbench/data/padchest/datamodule.py b/src/ptbench/data/padchest/datamodule.py
index 5057d86f..a09c5e67 100644
--- a/src/ptbench/data/padchest/datamodule.py
+++ b/src/ptbench/data/padchest/datamodule.py
@@ -57,7 +57,7 @@ class RawDataLoader(_BaseRawDataLoader):
         # N.B.: PadChest images are encoded as 16-bit grayscale images
         image = PIL.Image.open(os.path.join(self.datadir, sample[0]))
         image = remove_black_borders(image)
-        array = numpy.array(image).astype(numpy.float32) / 65536
+        array = numpy.array(image).astype(numpy.float32) / 65535
         tensor = to_tensor(array)
         tensor = center_crop(tensor, min(*tensor.shape[1:]))
 
-- 
GitLab