JaidedAI / EasyOCR

Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.
https://www.jaided.ai
Apache License 2.0
23k stars 3.03k forks source link

Dont want detection. Only want Recogntion #771

Open ahmadmustafaanis opened 2 years ago

ahmadmustafaanis commented 2 years ago

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'
piyawat-at commented 2 years ago

Following by https://www.jaided.ai/easyocr/documentation/ Using reader.recognize

reader = easyocr.Reader(lang_list  = ['en'],gpu = True)
reader.recognize(image_path)
mitesh741 commented 6 months ago

I want only detection. I do not want recognition. Also how can I train detector?

Much appreciated.

ahmadmustafaanis commented 6 months ago
reader.detect()

should do the same I believe from https://www.jaided.ai/easyocr/documentation/

mitesh741 commented 6 months ago

It does not work.

babyta commented 2 months ago

horizontal_list,free_list = reader.detect(img)