Skip to content

Commit d342133

Browse files
authored
Add Dockerfile for reproductible generation (#75)
* Add Dockerfile * Update README.md
1 parent 90c2e0d commit d342133

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# We use Ubuntu as base image
2+
FROM ubuntu:18.04
3+
4+
WORKDIR /app
5+
6+
# Install dependencies
7+
RUN apt-get update \
8+
&& apt-get upgrade -y \
9+
&& apt-get install -y \
10+
locales \
11+
python3-pip \
12+
libsm6 \
13+
libfontconfig1 \
14+
libxrender1 \
15+
libxext6 \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
# Set the locale
19+
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
20+
locale-gen
21+
ENV LANG en_US.UTF-8
22+
ENV LANGUAGE en_US:en
23+
ENV LC_ALL en_US.UTF-8
24+
25+
COPY requirements.txt /app/
26+
27+
RUN pip3 install -r requirements.txt
28+
29+
COPY TextRecognitionDataGenerator/ /app

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
A synthetic data generator for text recognition
44

55
## What is it for?
6+
67
Generating text image samples to train an OCR software. Now supporting non-latin text! For a more thorough tutorial see [the official documentation](https://textrecognitiondatagenerator.readthedocs.io/en/latest/index.html).
78

89
## What do I need to make it work?
@@ -21,6 +22,18 @@ tqdm
2122

2223
You can simply use `pip install -r requirements.txt` too.
2324

25+
## Docker image
26+
27+
If you would rather not have to install anything to use TextRecognitionDataGenerator, you can pull the docker image.
28+
29+
```
30+
docker pull belval/trdg:latest
31+
32+
docker run /output/path/:/app/out/ -t belval/trdg:latest python3 run.py [args]
33+
```
34+
35+
The path (`/output/path/`) must be absolute.
36+
2437
## New
2538
- Add `--font` to use only one font for all the generated images (Thank you @JulienCoutault!)
2639
- Add `--fit` and `--margins` for finer layout control

0 commit comments

Comments
 (0)