Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -173,9 +173,8 @@ async def predict(payload: ImagePayload):
|
|
| 173 |
if not img_base64:
|
| 174 |
return {"error": "No image provided"}
|
| 175 |
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
# Preprocess
|
| 180 |
processed_img = preprocess_image(image)
|
| 181 |
|
|
|
|
| 173 |
if not img_base64:
|
| 174 |
return {"error": "No image provided"}
|
| 175 |
|
| 176 |
+
if img_base64.startswith("data:image"):
|
| 177 |
+
img_base64 = img_base64.split(",")[1]
|
|
|
|
| 178 |
# Preprocess
|
| 179 |
processed_img = preprocess_image(image)
|
| 180 |
|