EasyOCR icon indicating copy to clipboard operation
EasyOCR copied to clipboard

Can anybody fix my problem pls.

Open Tfyourhelp opened this issue 2 years ago • 0 comments

  • I cant import easyocr although i installed it successfully, so i used this code to import easy ocr: !pip install git+https://github.com/jaidedai/easyocr.git cd easyocr !python setup.py install import easyocr

  • After that i write : detection_threshold = 0.7 image = image_np_with_detections scores = list(filter(lambda x: x> detection_threshold, detections['detection_scores'])) boxes = detections['detection_boxes'][:len(scores)] classes = detections['detection_classes'][:len(scores)] width = image.shape[1] height = image.shape[0] for idx, box in enumerate(boxes): print(box) roi = box*[height,width,height,width] print(roi) region = image[int(roi[0]):int(roi[2]),int(roi[1]):int(roi[3])] reader = easyocr.Reader(['en']) ocr_result = reader.readtext(region) print(ocr_result) plt.imshow(cv2.cvtColor(region,cv2.COLOR_BGR2RGB))

  • And i have an error that : AttributeError Traceback (most recent call last) Input In [30], in <cell line: 2>() 5 print(roi) 6 region = image[int(roi[0]):int(roi[2]),int(roi[1]):int(roi[3])] ----> 7 reader = easyocr.Reader(['en']) 8 ocr_result = reader.readtext(region) 9 print(ocr_result)

AttributeError: module 'easyocr' has no attribute 'Reader'

I also have a look on post (on github) that has same problem with me. But i do followed (change the easyocr.py name ) and it still not work pls help me

Tfyourhelp avatar Mar 26 '22 14:03 Tfyourhelp