Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,6 @@ 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 |
|
| 14 |
crop_width = random.randint(min_size, min(max_size, width))
|
|
@@ -52,6 +51,7 @@ file_name = st.file_uploader("Choose an image...")
|
|
| 52 |
if file_name is not None:
|
| 53 |
col1, col2 = st.columns(2)
|
| 54 |
image = Image.open(file_name)
|
|
|
|
| 55 |
|
| 56 |
if image.size != (200, 200) or image.mode != 'RGB':
|
| 57 |
#image = random_crop(image)
|
|
|
|
| 8 |
from huggingface_hub import snapshot_download
|
| 9 |
|
| 10 |
def random_crop(img, min_size=160, max_size=2048, ratio=5/8):
|
|
|
|
| 11 |
width, height = img.size
|
| 12 |
|
| 13 |
crop_width = random.randint(min_size, min(max_size, width))
|
|
|
|
| 51 |
if file_name is not None:
|
| 52 |
col1, col2 = st.columns(2)
|
| 53 |
image = Image.open(file_name)
|
| 54 |
+
image = ImageOps.exif_transpose(image)
|
| 55 |
|
| 56 |
if image.size != (200, 200) or image.mode != 'RGB':
|
| 57 |
#image = random_crop(image)
|