Spaces:
Running
on
Zero
Running
on
Zero
fix crop
Browse files
app.py
CHANGED
@@ -1297,7 +1297,7 @@ def make_dataset_images_section(advanced=False, is_random=False):
|
|
1297 |
del dataset
|
1298 |
|
1299 |
if dataset_name in CENTER_CROP_DATASETS:
|
1300 |
-
def center_crop_image(
|
1301 |
# image: PIL image
|
1302 |
w, h = img.size
|
1303 |
min_hw = min(h, w)
|
@@ -1308,7 +1308,7 @@ def make_dataset_images_section(advanced=False, is_random=False):
|
|
1308 |
bottom = top + min_hw
|
1309 |
print(left, top, right, bottom)
|
1310 |
img = img.crop((left, top, right, bottom))
|
1311 |
-
return
|
1312 |
images = [center_crop_image(image) for image in images]
|
1313 |
|
1314 |
return images
|
|
|
1297 |
del dataset
|
1298 |
|
1299 |
if dataset_name in CENTER_CROP_DATASETS:
|
1300 |
+
def center_crop_image(img):
|
1301 |
# image: PIL image
|
1302 |
w, h = img.size
|
1303 |
min_hw = min(h, w)
|
|
|
1308 |
bottom = top + min_hw
|
1309 |
print(left, top, right, bottom)
|
1310 |
img = img.crop((left, top, right, bottom))
|
1311 |
+
return img
|
1312 |
images = [center_crop_image(image) for image in images]
|
1313 |
|
1314 |
return images
|