mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-09-01 12:49:50 +08:00
Fix image cropping
This commit is contained in:
@@ -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))
|
||||
|
Reference in New Issue
Block a user