Fix image cropping

This commit is contained in:
Angelos Katharopoulos
2024-10-10 03:17:23 -07:00
parent fc88e3b0d0
commit 8c3b25f88c

View File

@@ -53,10 +53,12 @@ class FinetuningDataset:
if width != height:
side = min(width, height)
img = img.crop(
(width - side) / 2,
(height - side) / 2,
(width + side) / 2,
(height + side) / 2,
(
(width - side) / 2,
(height - side) / 2,
(width + side) / 2,
(height + side) / 2,
)
)
img = img.resize(self.args.resolution, Image.LANCZOS)
img = mx.array(np.array(img))