Omnibus commited on
Commit
15ea0c9
Β·
1 Parent(s): 901177c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -234,7 +234,6 @@ def detect(img, target_lang,trans_lang,target_lang2=None):
234
  else:
235
  lang=[f"{ocr_id[target_lang]}"]
236
  pass
237
- #global bounds
238
  img=cv2.imread(img)
239
  im_h = img.shape[0]
240
  im_w = img.shape[1]
@@ -248,6 +247,7 @@ def detect(img, target_lang,trans_lang,target_lang2=None):
248
  img = cv2.resize(img,(1000,1000))
249
  reader = easyocr.Reader(lang)
250
  bounds = reader.readtext(img)
 
251
  im = PIL.Image.open(img)
252
  im_out=draw_boxes(im, bounds)
253
  #im.save('result.jpg')
 
234
  else:
235
  lang=[f"{ocr_id[target_lang]}"]
236
  pass
 
237
  img=cv2.imread(img)
238
  im_h = img.shape[0]
239
  im_w = img.shape[1]
 
247
  img = cv2.resize(img,(1000,1000))
248
  reader = easyocr.Reader(lang)
249
  bounds = reader.readtext(img)
250
+ img = Image.fromarray(img)
251
  im = PIL.Image.open(img)
252
  im_out=draw_boxes(im, bounds)
253
  #im.save('result.jpg')