How remtir/aksonocr-lite works
AksonOCR-Lite converts image or PDF pages into Markdown, text, or structured JSON, combining layout, OCR, reading order, and table reconstruction. The public Python API and CLI lead into a page converter that orchestrates input loading, optional dewarping, orientation correction, layout and line OCR, table handling, and result formatting. Model sessions are shared infrastructure, with weights fetched from Hugging Face or loaded locally. The README documents the stages; some internal pipeline calls were not shown, so those links cite the README rather than implying unsampled code was inspected.
Main entry points: pipeline.py Page converter · models.py Model sessions · layout.py Layout analysis · __init__.py Python API
Components 18
User interfaces
- CLI
aksonocr_lite/cli.py - Python API
aksonocr_lite/__init__.py
Page processing
- Page converter
aksonocr_lite/pipeline.py - Page loading
aksonocr_lite/inputs.py - Page dewarping
aksonocr_lite/dewarp.py - Page orientation
aksonocr_lite/orient.py - Layout analysis
aksonocr_lite/layout.py - Layout postprocess
aksonocr_lite/_vendor/paddlex_layout.py - Line detection
aksonocr_lite/det.py - Line orientation
aksonocr_lite/orient.py - Thai recognizer
aksonocr_lite/rec.py - Table structure
aksonocr_lite/table.py
Model inference
- Model sessions
aksonocr_lite/models.py - Hugging Face weights
- Local weights
Structured results
- Page schema
aksonocr_lite/schema.py - Markdown output
aksonocr_lite/pipeline.py
Other components
- Document user
Connections 23
- Document user → CLI: runs
README.md - Document user → Python API: calls
README.md - CLI → Python API: loads
aksonocr_lite/cli.py - Python API → Page converter: creates
aksonocr_lite/__init__.py - Page converter → Page loading: loads pages
README.md - Page converter → Page dewarping: optionally dewarps
aksonocr_lite/pipeline.py - Page converter → Page orientation: corrects rotation
README.md - Page converter → Layout analysis: detects layout
README.md - Layout analysis → Layout postprocess: postprocesses
aksonocr_lite/layout.py - Page converter → Line detection: detects lines
README.md - Page converter → Line orientation: checks line orientation
README.md - Page converter → Thai recognizer: recognizes lines
README.md - Page converter → Table structure: builds tables
README.md - Page converter → Page schema: returns page data
aksonocr_lite/pipeline.py - Page converter → Markdown output: formats Markdown
README.md - Line detection → Model sessions: opens session
aksonocr_lite/det.py - Page dewarping → Model sessions: opens sessions
aksonocr_lite/dewarp.py - Layout analysis → Model sessions: opens session
aksonocr_lite/layout.py - Page orientation → Model sessions: opens session
aksonocr_lite/orient.py - Thai recognizer → Model sessions: opens session
aksonocr_lite/rec.py - Table structure → Model sessions: opens session
aksonocr_lite/table.py - Model sessions → Hugging Face weights: downloads
aksonocr_lite/models.py - Model sessions → Local weights: loads when configured
aksonocr_lite/models.py