docling icon indicating copy to clipboard operation
docling copied to clipboard

Allowing EasyOCR to use the recog_network parameter

Open itsainii opened this issue 1 year ago • 1 comments

In EasyOCR, there is a parameter called recog_network that allows users to load their own custom recognition models. You can find the related documentation here and here.

I wanted to add this parameter to the EasyOCR model code and tried the following:

In easyocr_model.py: I added the line below in the Reader class: recog_network = self.options.recog_network

image

In pipeline_options.py: I updated the EasyOcrOptions class by adding this line: recog_network: Optional[str] = 'standard'

image

This is how I used the parameter in the pipeline: pipeline_options.ocr_options = EasyOcrOptions(lang=['en'], recog_network='custom_example')

Let me know if you have any question or suggestion.

itsainii avatar Dec 16 '24 05:12 itsainii

@itsainii That looks interesting! Could you please make a pull request with the code changes? Many thanks.

cau-git avatar Dec 16 '24 07:12 cau-git