Skip to content
项目

Franky1/Tesseract-OCR-5-Docker

在 GitHub 查看

关于

Docker Image with latest Tesseract OCR Version 5.x.x built from sources

系统与基础设施

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

License Issues Last Commit

Docker Docker Docker

Tesseract-OCR-5-Docker :scroll:

Docker Image with latest Tesseract OCR Version 5.x.x built from sources.

The sources are pulled from the latest main branch and latest releases of the Tesseract OCR project.

Docker Hub: https://hub.docker.com/r/franky1/tesseract

Usage :hammer_and_wrench:

Pull Docker Image :keyboard:

Pull the docker image from Docker Hub:

docker pull franky1/tesseract

Run Docker Container :keyboard:

Mount your image data to the /tmp directory and run Tesseract OCR container with the required command line options, for example, run Tesseract OCR container with test image:

docker run -it -v ${PWD}/testdata:/tmp --rm franky1/tesseract \
  tesseract english.png output --oem 1 -l eng

For the Tesseract command line options, please refer to the Tesseract Manual

Mount more languages :speaking_head:

Test if the mounted languages from your local subfolder /tessdata are available in the Docker container. Be aware that the local languages overwrite the installed languages in the Docker image. Example here with french language:

docker run -it -v ${PWD}/testdata:/tmp \
  -v ${PWD}/tessdata:/usr/local/share/tessdata/ \
  --rm franky1/tesseract

Test the mounted languages in the Docker container with a sample image. Example here with french language:

docker run -it -v ${PWD}/testdata:/tmp \
  -v ${PWD}/tessdata:/usr/local/share/tessdata/ \
  --rm franky1/tesseract \
  tesseract french.jpg output --oem 1 -l fra

Alternatively, you can build a new Docker image if you want other languages, see next section.

Build Docker Image yourself :whale:

For details have a look into the Dockerfile.

  1. Git clone this repo.
  2. Add your required languages to the languages.txt file.
  3. Build the docker image.
    • To build with the main branch of Tesseract:
      docker build --progress=plain --tag tesseract .
      
    • To build with a specific release version of Tesseract:
      docker build --progress=plain --tag tesseract --build-arg TESSERACT_VERSION=5.0.0 .
      
  4. Run Tesseract OCR container with test image:
docker run -it --name tesseract -v ${PWD}/testdata:/tmp --rm \
  tesseract tesseract english.png output --oem 1 -l eng

Image conditions :ballot_box_with_check:

  • Only supported target for this docker image currently is linux/amd64.
  • Working directory for ocr images is /tmp inside the container. See example above.
  • Directory for trained data is /usr/local/share/tessdata/ inside the container. See example above.
  • This image was built without the Tesseract training tools.
  • This image currently includes only the following languages:
    • English: tessdata_best > eng.traineddata
    • German: tessdata_best > deu.traineddata
    • If you need other languages, you have to build your own image or mount trained data to the /usr/local/share/tessdata/ directory. See example above.

Tesseract Trained Data for all available languages :weight_lifting:

Further documentation :link:

ToDo :white_check_mark:

  • Update README.md to latest Dockerfile and Usage
  • Add dependabot on Github
  • Add vulnerability scanning in Github Actions with Snyk
  • Use multi-stage build in Dockerfile and clone from git
  • Add GitHub Action for check container efficiency with Dive https://github.com/MartinHeinz/dive-action
  • Add documentation for GitHub Actions Workflow
  • Add more inline comments in GitHub Actions related files
  • Build image for more targets
  • Building Tesseract with TensorFlow?
  • Building Tesseract with Training tools?

Issues :bug:

If you have any bugs or requests regarding this Docker image, please post an issue in this Github Repository.

Project status :heavy_check_mark:

11.09.2025: Docker Image is ready for usage, still some slight improvements possible, sometimes build issues

探索相关项目

加载中…