How githubharald/simplehtr works
This repository is a TensorFlow handwritten-text recognition system for IAM word images and multiword text lines. Its main workflow accepts a command-line inference request, preprocesses an image, runs the CNN/RNN model and CTC decoder, and reports recognized text and probability. Training and validation use IAM batches, with optional LMDB-backed image loading; training also produces model snapshots and decoder vocabulary files. The graph includes these documented capabilities. Evidence is limited to the README and sampled source excerpts, so unsampled implementation details are omitted.
Main entry points: main.py Mode controller · model.py CTC decoders · dataloader_iam.py IAM batch loader · preprocessor.py Image preprocessing
Components 19
Run and evaluation
- Mode controller
src/main.py - Recognized text
- Validation metrics
src/main.py
IAM data preparation
- Image preprocessing
src/preprocessor.py - Line synthesis
src/preprocessor.py - IAM batch loader
src/dataloader_iam.py - IAM dataset
- LMDB creator
src/create_lmdb.py - LMDB image store
Recognition model
- CNN features
src/model.py - Bidirectional RNN
src/model.py - CTC loss
src/model.py - CTC decoders
src/model.py - Word beam package
Model artifacts
- Model snapshots
- Decoder vocabulary files
- Word corpus
data/corpus.txt - Word character list
model/wordCharList.txt
Other components
- CLI user
Connections 19
- CLI user → Mode controller: selects mode
src/main.py - Mode controller → IAM batch loader: loads batches
src/main.py - IAM batch loader → IAM dataset: reads IAM files
src/dataloader_iam.py - LMDB creator → LMDB image store: writes images
src/create_lmdb.py - IAM batch loader → LMDB image store: reads images
src/dataloader_iam.py - Mode controller → Image preprocessing: processes images
src/main.py - Image preprocessing → Line synthesis: synthesizes lines
src/preprocessor.py - Mode controller → CNN features: runs model
src/main.py - CNN features → Bidirectional RNN: features to sequence
src/model.py - Bidirectional RNN → CTC loss: sequence logits
src/model.py - CTC loss → CTC decoders: decodes logits
src/model.py - CTC decoders → Word beam package: optional word decoding
README.md - Mode controller → Recognized text: prints recognition
src/main.py - Mode controller → Validation metrics: validates results
src/main.py - Mode controller → Model snapshots: saves or restores
src/main.py - Mode controller → Decoder vocabulary files: writes character list
src/main.py - Mode controller → Word corpus: writes training words
src/main.py - CTC decoders → Word corpus: reads dictionary
src/model.py - CTC decoders → Word character list: reads character classes
src/model.py