EasyOCR
EasyOCR copied to clipboard
Dont want detection. Only want Recogntion
I do not want to perform detection first, then recognition. I want to perform recognition straight on the image i pass.
Code:
self.ocr = easyocr.Reader(
["en"],
gpu=False,
detector=False,
quantize=True,
recognizer=True,
)
return self.ocr.readtext(path_to_img)
But I get this error
File "/home/ahmad/Desktop/FYP/venv/lib/python3.7/site-packages/easyocr/easyocr.py", line 397, in readtext
add_margin, False)
File "/home/ahmad/Desktop/FYP/venv/lib/python3.7/site-packages/easyocr/easyocr.py", line 279, in detect
text_box_list = get_textbox(self.detector, img, canvas_size, mag_ratio,
AttributeError: 'Reader' object has no attribute 'detector'
Following by https://www.jaided.ai/easyocr/documentation/ Using reader.recognize
reader = easyocr.Reader(lang_list = ['en'],gpu = True)
reader.recognize(image_path)
I want only detection. I do not want recognition. Also how can I train detector?
Much appreciated.
reader.detect()
should do the same I believe from https://www.jaided.ai/easyocr/documentation/
It does not work.