From cc49786ee959b88944131c88177655e84e6088f7 Mon Sep 17 00:00:00 2001 From: Jaret Burkett Date: Sun, 27 Aug 2023 14:36:38 -0600 Subject: [PATCH] Dataloader bug fixes --- toolkit/dataloader_mixins.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/toolkit/dataloader_mixins.py b/toolkit/dataloader_mixins.py index 7234551b..fea29421 100644 --- a/toolkit/dataloader_mixins.py +++ b/toolkit/dataloader_mixins.py @@ -107,6 +107,7 @@ class BucketsMixin: # reduce it to the nearest divisible number reduction = new_width % bucket_tolerance file_item.crop_width = new_width - reduction + new_width = file_item.crop_width # adjust the new x position so we evenly crop file_item.crop_x = int(file_item.crop_x + (reduction / 2)) elif height > width: @@ -121,6 +122,7 @@ class BucketsMixin: # reduce it to the nearest divisible number reduction = new_height % bucket_tolerance file_item.crop_height = new_height - reduction + new_height = file_item.crop_height # adjust the new x position so we evenly crop file_item.crop_y = int(file_item.crop_y + (reduction / 2)) else: