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
24.52k stars 3.16k forks source link

offline using #1332

Open paul-yangmy opened 3 days ago

paul-yangmy commented 3 days ago

I have downloaded models and set the model_storage_directory to a local path. But it still gave an error like: urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>. Could I use easyocr without internet access? Thanks!

romanvelichkin commented 3 days ago

Yes, you can.

Download models "craft_mlt_25k.pth" and your language model "your_lang_model.pth" and put them into folder you want.

In your code call your models that way:

reader = easyocr.Reader(lang_list=['your_lang'], 
                        model_storage_directory='folder1/folder2/models_folder',
)

I think you're just using wrong path. Debug your code, check if script has proper access to your model folder by:

import os

for model_file in os.listdir('path_to_your_model_folder'):
    print(model_file)
paul-yangmy commented 3 days ago

still not work :( image

romanvelichkin commented 3 days ago

Delete models (or change models folder) and give easyocr to download everything it wants. Check models that it downloaded. And then try to run detection with models it downloaded offline.

paul-yangmy commented 3 days ago

Sorry, it's in an intranet environment, and cannot let easyocr download it by itself. I deployed it according to the local environment. Is there something missing? image

paul-yangmy commented 3 days ago

Sorry, it's in an intranet environment, and cannot let easyocr download it by itself. I deployed it according to the local environment. Is there something missing? image

Sorry, my fault. I download the wrong Chinese lang model :( Thanks! image