Practical overview
When it fits
Use Crnn when you need a Torch7-based recognizer for text already present in images, or when you want to train a recognition model from an LMDB dataset.
Who it is for
- Developers adding image-based text recognition to an OCR or image-processing workflow.
- Researchers or practitioners training sequence-recognition models from an LMDB dataset.
Documented uses
- Recognize text in images with the included pretrained model.
- Choose lexicon-free or lexicon-based recognition functions.
- Prepare a custom LMDB dataset and configuration for model training.
Requirements & limits
- The documented implementation uses Lua, Torch7 and C++ rather than a PyTorch-native codebase.
- A CUDA-enabled GPU is required; the README says the software was tested on Ubuntu 14.04 (x64).
- The repository documents recognition, while an end-to-end detector-plus-recognizer is pointed to as a separate implementation.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Run the pretrained image-recognition demo
Use the included demo program to recognize text in its example image.
Before you start
- Torch7 and the project's build dependencies: fblualib and LMDB.
- A CUDA-enabled GPU.
- A pretrained model downloaded as crnn_demo_model.t7.
Steps
Build the C++ code from the src directory by running sh build_cpp.sh.
Place crnn_demo_model.t7 in the model/crnn_demo/ directory.
From src, launch the demo with th demo.lua.
Expected outcome
The demo reads an example image and prints recognized text.
Guide limitations
- The README reports testing only on Ubuntu 14.04 (x64).
- The demo instructions use a pretrained model and example image; they do not describe a complete deployment workflow.
Prepare a custom training dataset and configuration
Set up the files needed to train Crnn on a custom dataset.
Before you start
- A dataset prepared for conversion to LMDB.
- Python with the lmdb package installed.
- A model directory and a configuration based on model/crnn_demo/config.lua.
Steps
Use tool/create_dataset.py and its createDataset function to create an LMDB dataset.
Create a directory under model/ for the new model.
Copy and modify model/crnn_demo/config.lua into that directory.
Expected outcome
An LMDB dataset and model configuration are prepared for the documented training stage.
Guide limitations
- The setup instructions alone do not train the model; the README gives a separate next step using src/main_train.lua.
- CUDA-enabled GPUs are required, and the README reports testing only on Ubuntu 14.04 (x64).
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 October 2026
- Original website title
- bgshih/crnn · Official homepage title · retained in its source language

