Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -103,6 +103,7 @@ async def ocr(request: Request,
|
|
103 |
file_bytes = np.asarray(bytearray(image_stream.read()), dtype=np.uint8)
|
104 |
frame = cv2.imdecode(file_bytes, cv2.IMREAD_COLOR)
|
105 |
label = read_img(frame)
|
106 |
-
|
107 |
-
|
|
|
108 |
return {"ImageText" : label}
|
|
|
103 |
file_bytes = np.asarray(bytearray(image_stream.read()), dtype=np.uint8)
|
104 |
frame = cv2.imdecode(file_bytes, cv2.IMREAD_COLOR)
|
105 |
label = read_img(frame)
|
106 |
+
print("[label]",label)
|
107 |
+
except Exception as e:
|
108 |
+
return {"error": str(e)}, 500
|
109 |
return {"ImageText" : label}
|