CaesarCloudSync commited on
Commit
115c701
1 Parent(s): 4b734ff

CaesarAI Fixed I think

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -227,7 +227,7 @@ def caesarocr(frames: CaesarOCRHTTPModel):
227
  # listen for connections
228
  try:
229
  frames = dict(frames)
230
- image_arr = np.frombuffer(base64.b64decode(frames["frame"]),dtype="uint8")
231
  image = cv2.imdecode(image_arr,flags=cv2.IMREAD_COLOR)
232
  # .reshape(frames["shape"][0],frames["shape"][1],3)
233
  string = pytesseract.image_to_string(image)
 
227
  # listen for connections
228
  try:
229
  frames = dict(frames)
230
+ image_arr = np.frombuffer(base64.b64decode(frames["frame"].replace("data:image/jpeg;base64,","").replace("data:image/png;base64,","")),dtype="uint8")
231
  image = cv2.imdecode(image_arr,flags=cv2.IMREAD_COLOR)
232
  # .reshape(frames["shape"][0],frames["shape"][1],3)
233
  string = pytesseract.image_to_string(image)