Spaces:
Sleeping
Sleeping
mateoluksenberg
commited on
Update app.py
Browse files
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(
|
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 |
|