Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ import io
|
|
8 |
def predict_input_image(img):
|
9 |
# Normalize the image by cropping (center crop)
|
10 |
img = Image.open(io.BytesIO(img))
|
11 |
-
h, w = img.size
|
12 |
crop_start_x = (w - 224) // 2
|
13 |
crop_start_y = (h - 224) // 2
|
14 |
img = img.crop((crop_start_x, crop_start_y, crop_start_x + 224, crop_start_y + 224))
|
|
|
8 |
def predict_input_image(img):
|
9 |
# Normalize the image by cropping (center crop)
|
10 |
img = Image.open(io.BytesIO(img))
|
11 |
+
h, w,_ = img.size
|
12 |
crop_start_x = (w - 224) // 2
|
13 |
crop_start_y = (h - 224) // 2
|
14 |
img = img.crop((crop_start_x, crop_start_y, crop_start_x + 224, crop_start_y + 224))
|