Minimal Qt6 GUI launcher for batch HTR processing with live output monitoring.
Polyscriptor Batch GUI is a CLI wrapper - it builds and executes batch_processing.py commands with a user-friendly interface. This ensures CLI/GUI parity (they run identical code).
- ✅ Engine Selection: PyLaia, TrOCR, Qwen3-VL, Party, Kraken, Churro
- ✅ Model Configuration: Local file paths or HuggingFace model IDs
- ✅ Segmentation Options: Kraken (neural), HPP (fast), None (pre-segmented)
- ✅ PAGE XML Auto-Detection: Automatically uses PAGE XML if available
- ✅ Output Formats: TXT, CSV, PAGE XML, JSON (multi-select)
- ✅ Preset System: Save/load common configurations
- ✅ Live Execution: Real-time stdout/stderr streaming in dialog
- ✅ Command Preview: See exact command before execution
- ✅ Validation: Input validation before running
source htr_gui/bin/activate
python polyscriptor_batch_gui.py- Select Input Folder: Click "Browse..." to choose folder with manuscript images
- Choose Engine: Select from dropdown (e.g., PyLaia for Church Slavonic)
- Load Preset (Optional): Select built-in preset like "Church Slavonic (PyLaia + Kraken)"
- Configure Model: Browse to local
.ptfile or enter HuggingFace model ID - Set Segmentation: Choose method (Kraken recommended) and enable PAGE XML if available
- Select Output Formats: Check TXT, CSV, or PAGE XML
- Test First: Click "Dry Run (Test First)" to validate configuration
- Start Processing: Click "Start Batch Processing" and watch live output
- Church Slavonic (PyLaia + Kraken):
models/pylaia_church_slavonic_20251103_162857/best_model.pt - Ukrainian (PyLaia + Kraken):
models/pylaia_ukrainian_pagexml_20251101_182736/best_model.pt - Glagolitic (PyLaia + Kraken):
models/pylaia_glagolitic_with_spaces_20251102_182103/best_model.pt - Russian (TrOCR HF):
kazars24/trocr-base-handwritten-ru
- Configure your settings
- Click "Save" button
- Enter preset name
- Preset saved to
~/.config/polyscriptor/presets.json - Reload GUI to see new preset in dropdown
- Requires local model path (
.ptfile) - Best for trained historical manuscripts
- Supports both local models and vocabulary files
- Supports both local checkpoints and HuggingFace models
- Num Beams control appears (1=fast, 4=quality)
- Default segmentation: Kraken
- Requires HuggingFace model ID
- WARNING: Very slow (~1-2 min/page)
- Only use for small batches or complex layouts
- Default segmentation: None (whole page)
- Requires local
.safetensorsmodel file - Works best with PAGE XML input
- Batch-optimized for speed
- Default segmentation: None (uses PAGE XML)
When you click "Dry Run" or "Start Batch Processing", the GUI:
- Validates your configuration
- Opens execution dialog showing:
- Full command being executed
- Live stdout/stderr output (auto-scrolling)
- Color-coded error messages (red)
- Success/failure indicator on completion
- Allows you to copy command to clipboard
- Keeps process alive until you close dialog
The bottom panel shows the exact command that will be executed:
python batch_processing.py --input-folder HTR_Images/my_folder \
--engine PyLaia --model-path models/pylaia_church_slavonic.../best_model.pt \
--device cuda:0 --segmentation-method kraken --use-pagexml \
--output-format txt --output-format csvThis updates in real-time as you change settings.
"Model file does not exist"
- Check that model path is absolute or relative to project root
- Use "Browse..." button to ensure correct path
"Input folder does not exist"
- Verify folder path is correct
- Use "Browse..." button to select folder
"Please select at least one output format"
- Check at least one format: TXT, CSV, or PAGE XML
GUI doesn't open
- Ensure PyQt6 is installed:
pip install PyQt6 - Check virtual environment is activated
Process output not showing
- Check that
batch_processing.pyis in same directory - Verify Python path is correct in execution
Design Philosophy: "CLI wrapper, not reimplementation"
The GUI:
- Builds command-line arguments from form inputs
- Executes
batch_processing.pyvia QProcess - Streams output to dialog in real-time
- Does NOT duplicate batch processing logic
This ensures:
- CLI and GUI always behave identically
- Easy maintenance (only one implementation)
- Full access to all CLI features
- No code duplication
- GUI Script:
polyscriptor_batch_gui.py - Presets:
~/.config/polyscriptor/presets.json - Batch Processor:
batch_processing.py(backend)
- batch_processing.py - CLI batch processor (backend)
- POLYSCRIPTOR_BATCH_GUI_PLAN.md - Design documentation
- CLAUDE.md - Project overview and recent improvements