faustomorales / keras-ocr

A packaged and flexible version of the CRAFT text detector and Keras CRNN recognition model.
https://keras-ocr.readthedocs.io/
MIT License
1.36k stars 347 forks source link

Pipeline() constructor needs parameters for loading models/weights from local filesystem #205

Open dbbyres opened 2 years ago

dbbyres commented 2 years ago

I'm trying to use Keras_ocr in an environment that does not permit outbound traffic to external web sites. The default Pipeline initialization ("pipeline = keras_ocr.pipeline.Pipeline()") fails with an access forbidden error. Can it be made possible to specify local files containing the pre-trained models and weights? Thank you.

pure-zero commented 2 years ago

As a workaround, I have found you can set the environment variable KERAS_OCR_CACHE_DIR to be where you hold the local files.