Spaces:
Runtime error
Runtime error
Jimmy N
commited on
Commit
·
f7f64f8
1
Parent(s):
64b9b32
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,8 @@ from PIL import Image
|
|
| 6 |
pipe = pipeline("image-classification", model="yangy50/garbage-classification")
|
| 7 |
|
| 8 |
def classify_image(image):
|
|
|
|
|
|
|
| 9 |
results = pipe(image)
|
| 10 |
return {result['label']: result['score'] for result in results}
|
| 11 |
|
|
|
|
| 6 |
pipe = pipeline("image-classification", model="yangy50/garbage-classification")
|
| 7 |
|
| 8 |
def classify_image(image):
|
| 9 |
+
# Ensure image is in RGB mode
|
| 10 |
+
image = image.convert("RGB")
|
| 11 |
results = pipe(image)
|
| 12 |
return {result['label']: result['score'] for result in results}
|
| 13 |
|