Stefano5699 commited on
Commit
b13c647
·
verified ·
1 Parent(s): cc2e0bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
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