A Docker image built through GitHub Actions with Git commit version tags.
I discovered that EasyOCR provides a Dockerfile but does not offer a prebuilt Docker image for running demos. Additionally, its models are hosted on GitHub Releases and downloaded at runtime, which makes offline mode challenging. Hosting the models on HuggingFace Hub would enable local caching and leverage HuggingFace's self-hosted mirror for efficient downloads.
After reviewing the following resources:
This project uses GitHub Actions, Docker Hub, and HuggingFace Hub to build and publish Docker images and host models. The goal is to maintain a clean and automated process without requiring custom configuration files.
Docker images for this project are published on Docker Hub under the repository xiaoyao9184/easyocr.
The dependent models are hosted on HuggingFace Hub at xiaoyao9184/easyocr.
Since this project references the EasyOCR project via a Git submodule, it cannot monitor push events in the EasyOCR repository and therefore cannot automatically create images for every commit. A practical workaround is to manually trigger the GitHub Action and tag the image with the commit ID. For more details, see this article: Set Dynamic Parameters in GitHub Workflows.
The default image naming format is ${DOCKERHUB_USERNAME}/easyocr.
Commit-Based Tagging
The tag uses the input parameter commit_id, which can be either a branch name or a commit ID.
commit_id.master will be used instead of the commit_id.Version-Based Tagging
If the docker-image-tag-version job is triggered with the easyocr_version parameter (set to a PyPI EasyOCR version),
the build will use the EasyOCR package published on PyPI.
The resulting image will be tagged with the easyocr_version.
Currently, only the linux/amd64 platform is supported.
You can fork this project and build your own Docker image. To do so, you need to provide the following variables:
DOCKERHUB_USERNAMEDOCKERHUB_TOKENFor more details, see this guide.
Additionally, you need to provide your own HuggingFace account for storing the models. The required variables are:
HF_USERNAMEHF_TOKENContent type
Image
Digest
sha256:5faf8dea3…
Size
3.7 GB
Last updated
over 1 year ago
docker pull xiaoyao9184/easyocr