简体   繁体   English

泊坞窗上的 EasyOCR

[英]EasyOCR on docker

I created a Docker image that has a flask app that uses EasyOCR.我创建了一个 Docker 映像,其中包含一个使用 EasyOCR 的烧瓶应用程序。 When you run the docker app on a port, and the script calls the EasyOCR module, it starts downloading the character recognition model, which crashes and terminates the container.当您在端口上运行 docker 应用程序并且脚本调用 EasyOCR 模块时,它会开始下载字符识别模型,该模型会崩溃并终止容器。 Is there a way I can copy the model to the docker file already, so it doesn't have to do that once I have to run it?有没有办法可以将模型复制到 docker 文件中,所以一旦我必须运行它就不必这样做?

I was with the same problem, and found the solution on the issues from EasyOCR: https://github.com/JaidedAI/EasyOCR/issues/706我遇到了同样的问题,并从 EasyOCR 中找到了问题的解决方案: https ://github.com/JaidedAI/EasyOCR/issues/706

Basically, you need to custom your Dockerfile like this:基本上,您需要像这样自定义 Dockerfile:

RUN wget https://github.com/JaidedAI/EasyOCR/releases/download/v1.3/english_g2.zip
RUN wget https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/craft_mlt_25k.zip
RUN mkdir ~/.EasyOCR
RUN mkdir ~/.EasyOCR/model
RUN unzip english_g2.zip -d ~/.EasyOCR/model
RUN unzip craft_mlt_25k.zip -d ~/.EasyOCR/model

This will download them manually from the model hub and put them in the '~/.EasyOCR/model' folder这将从模型中心手动下载它们并将它们放在'~/.EasyOCR/model'文件夹中

To see every model and choose what you need, follow to this link: https://www.jaided.ai/easyocr/modelhub/要查看每个模型并选择您需要的模型,请访问此链接: https ://www.jaided.ai/easyocr/modelhub/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM