mateoluksenberg commited on
Commit
be82676
·
verified ·
1 Parent(s): 9309109

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -15,13 +15,8 @@ async def classify_image(file: UploadFile = File(...)):
15
  # Read the file contents into a PIL image
16
  image = Image.open(file.file).convert('RGB')
17
 
18
- # Convert the image to bytes
19
- image_bytes = io.BytesIO()
20
- image.save(image_bytes, format='JPEG')
21
- image_bytes = image_bytes.getvalue()
22
-
23
  # Perform image classification
24
- result = pipe(image_bytes)
25
 
26
  return {"classification_result": result[0]} # Return the top prediction
27
 
 
15
  # Read the file contents into a PIL image
16
  image = Image.open(file.file).convert('RGB')
17
 
 
 
 
 
 
18
  # Perform image classification
19
+ result = pipe(image)
20
 
21
  return {"classification_result": result[0]} # Return the top prediction
22