Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ from PIL import Image, ImageOps
|
|
| 7 |
from io import BytesIO
|
| 8 |
from huggingface_hub import snapshot_download
|
| 9 |
|
| 10 |
-
def random_crop(img, min_size=
|
| 11 |
img = ImageOps.exif_transpose(img)
|
| 12 |
width, height = img.size
|
| 13 |
|
|
@@ -54,7 +54,7 @@ if file_name is not None:
|
|
| 54 |
image = Image.open(file_name)
|
| 55 |
|
| 56 |
if image.size != (200, 200) or image.mode != 'RGB':
|
| 57 |
-
image = random_crop(image)
|
| 58 |
image = image.resize((200, 200))
|
| 59 |
|
| 60 |
if image.format != "JPEG":
|
|
|
|
| 7 |
from io import BytesIO
|
| 8 |
from huggingface_hub import snapshot_download
|
| 9 |
|
| 10 |
+
def random_crop(img, min_size=160, max_size=2048, ratio=5/8):
|
| 11 |
img = ImageOps.exif_transpose(img)
|
| 12 |
width, height = img.size
|
| 13 |
|
|
|
|
| 54 |
image = Image.open(file_name)
|
| 55 |
|
| 56 |
if image.size != (200, 200) or image.mode != 'RGB':
|
| 57 |
+
#image = random_crop(image)
|
| 58 |
image = image.resize((200, 200))
|
| 59 |
|
| 60 |
if image.format != "JPEG":
|