Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -35,6 +35,12 @@ async def create_upload_file(file: UploadFile = File(...)):
|
|
35 |
# Check if img is None or not
|
36 |
if img is None:
|
37 |
return {"error": "Failed to open the image file."}
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
try:
|
40 |
# Assuming 'learn' is your image classifier model
|
|
|
35 |
# Check if img is None or not
|
36 |
if img is None:
|
37 |
return {"error": "Failed to open the image file."}
|
38 |
+
|
39 |
+
try:
|
40 |
+
# Resize the image to 300x300 pixels
|
41 |
+
img = img.resize((300, 300))
|
42 |
+
except Exception as e:
|
43 |
+
return {"error": "Failed to resize the image."}
|
44 |
|
45 |
try:
|
46 |
# Assuming 'learn' is your image classifier model
|