generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use better tesseract training dataset (#459)
* Download tessdata-best instead of tessdata-fast This should improve OCR performance using tesseract with only a mild increase in runtime and container size. * Drop unused `cdifflib`
- Loading branch information
Showing
5 changed files
with
17 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
FROM python:3.10-bullseye | ||
FROM python:3.10-slim | ||
|
||
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 tesseract-ocr-eng tesseract-ocr -y | ||
RUN apt-get update && apt-get install libgl1 tesseract-ocr-eng tesseract-ocr -y | ||
|
||
# Use larger "best" training data, rather than "fast" | ||
# Python one-liner because we don't have curl or wget | ||
RUN python3 -c 'from urllib.request import urlopen; open("/usr/share/tesseract-ocr/5/tessdata/eng.traineddata", "wb").write(urlopen("https://github.com/tesseract-ocr/tessdata_best/raw/refs/heads/main/eng.traineddata").read())' | ||
|
||
RUN pip install poetry | ||
|
||
COPY ./pyproject.toml /ocr/pyproject.toml | ||
COPY ./poetry.lock /ocr/poetry.lock | ||
|
||
WORKDIR /ocr | ||
RUN poetry install | ||
|
||
RUN poetry install && poetry cache list | xargs -n1 poetry cache clear --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters