From 3697b163444cb478be8669bd0b00db57572c98dc Mon Sep 17 00:00:00 2001 From: Victor Hall Date: Sun, 16 Apr 2023 02:19:27 -0400 Subject: [PATCH] put exif transpose back in preloading to fix bug --- data/image_train_item.py | 1 + 1 file changed, 1 insertion(+) diff --git a/data/image_train_item.py b/data/image_train_item.py index bc9435d..b57203c 100644 --- a/data/image_train_item.py +++ b/data/image_train_item.py @@ -237,6 +237,7 @@ class ImageTrainItem: self.target_wh = None try: with PIL.Image.open(self.pathname) as image: + image = ImageOps.exif_transpose(image) width, height = image.size image_aspect = width / height target_wh = min(self.aspects, key=lambda aspects:abs(aspects[0]/aspects[1] - image_aspect))