A fast, efficient web-based tool for manually labeling text in image crops for OCR training datasets.
- Fast Image Loading: Optimized batch loading with preloading for smooth workflow
- Random Image Order: Images load in random order to prevent annotation bias
- Keyboard Shortcuts: Quick navigation with Enter to save, Ctrl+Enter to skip
- RTL Text Support: Proper support for Persian, Arabic, and other RTL languages
- Progress Tracking: Real-time statistics on completed, skipped, and remaining images
- Undo Functionality: Go back to previous images and modify annotations
- Default Text Integration: Support for OCR model predictions as starting points
- Python 3.6 or higher
- Flask:
pip install flask
- Clone the repository:
git clone https://github.com/faezeam/ocr-annotation-tool
cd ocr-annotation-tool- Install dependencies:
pip install flask- Run the application:
python app.py- Open your browser and go to:
http://127.0.0.1:5000
- Place your image crops in the
crops/folder - (Optional) Create
labels/default.txtwith OCR predictions in in tab-separated format:filename.jpg predicted_text
- View Image: Each image displays in the center with filename shown above
- Enter Text: Type the text you see in the input field (supports RTL languages)
- Save: Press
Enterto save annotation and move to next image - Skip: Press
Ctrl+EnterorAlt+Sto skip difficult images - Undo: Click "Previous" button to go back and modify previous annotations
Enter- Save annotation and go to next imageCtrl+EnterorAlt+S- Skip current imageEsc- Clear input field
crops/- Place your image files here (.jpg, .png, .bmp, .tiff, .gif)completed/- Successfully annotated images are moved hereskipped/- Skipped images are moved herelabels/labels.txt- All annotations saved in tab-separated formatlabels/default.txt- Optional OCR predictions (tab-separated: filename→text)
Annotations are saved in labels/labels.txt in tab-separated format