Sign inSign up

xiaoyao9184/easyocr

By xiaoyao9184

Updated over 1 year ago

Image
0

1.7K

xiaoyao9184/easyocr repository overview

Docker EasyOCR

A Docker image built through GitHub Actions with Git commit version tags.

Why

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.

Tags

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.

Tagging Strategy
  1. Commit-Based Tagging The tag uses the input parameter commit_id, which can be either a branch name or a commit ID.

    • When the docker-image-tag-commit job is manually triggered, you can specify the commit_id.
    • If the job is triggered by a submodule update push, the default branch name master will be used instead of the commit_id.
    • This job also generates a tag with the shortened commit ID.
  2. 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.

Changes

You can fork this project and build your own Docker image. To do so, you need to provide the following variables:

  • DOCKERHUB_USERNAME
  • DOCKERHUB_TOKEN

For more details, see this guide.

Additionally, you need to provide your own HuggingFace account for storing the models. The required variables are:

  • HF_USERNAME
  • HF_TOKEN

Tag summary

Content type

Image

Digest

sha256:5faf8dea3

Size

3.7 GB

Last updated

over 1 year ago

docker pull xiaoyao9184/easyocr