put exif transpose back in preloading to fix bug

This commit is contained in:
Victor Hall 2023-04-16 02:19:27 -04:00
parent a5b22d85bd
commit 3697b16344
1 changed files with 1 additions and 0 deletions

View File

@ -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))