omkar56 commited on
Commit
1466daf
·
1 Parent(s): cf3fda6

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -2
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
- except error:
107
- return {"Error":"No post request found"}
 
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}