How ckhot18/lipilensv2 works
LipiLens is a web application for drafting and human-verifying transcriptions of historical Modi manuscripts. Its main flow uploads a scan, restores it, segments it for model inference, archives the draft, and supports later review and search; restoration preview is a separate CPU-only path. The README also describes evaluation as a standalone capability. Some route-to-service relationships are supported by the SOURCE INDEX; unsampled internals and integrations are not expanded beyond documented behavior.
Main entry points: client.js HTTP client · main.py FastAPI application · pipeline.py Pipeline orchestration · inference.py Inference selection
Components 24
Web interface
- LipiLens interface
frontend/src/App.jsx - Transcribe page
frontend/src/pages/Transcribe.jsx - Library page
frontend/src/pages/Library.jsx - HTTP client
frontend/src/api/client.js
API and workflow
- FastAPI application
backend/main.py - Manuscript routes
backend/api/manuscripts.py - Preview route
backend/api/preview.py - Verification routes
backend/api/transcriptions.py - Health route
backend/api/health.py - Pipeline orchestration
backend/services/pipeline.py - Runtime configuration
backend/config.py
Image processing
- Restoration pipeline
backend/services/restoration/pipeline.py - Restoration stages
backend/services/restoration/stages.py - Image I/O
backend/utils/image_io.py
Transcription
- Inference selection
backend/services/transcription/inference.py - Line segmentation
backend/services/transcription/segment.py - Local Qwen
backend/services/transcription/local_qwen.py - Colab client
backend/services/transcription/colab_client.py - Colab inference server
colab/lipilens_colab_server.py
Archive and evaluation
- Archive repository
backend/services/archive/repository.py - SQLite archive
backend/database/models.py - Database sessions
backend/database/session.py - CER/WER evaluation
experiments/evaluation/compute_metrics.py
Other components
- Manuscript user
Connections 34
- Manuscript user → LipiLens interface: uses
- LipiLens interface → Transcribe page: opens
frontend/src/App.jsx - LipiLens interface → Library page: opens
frontend/src/App.jsx - Transcribe page → HTTP client: requests
frontend/src/pages/Transcribe.jsx - Library page → HTTP client: requests
frontend/src/pages/Library.jsx - HTTP client → Manuscript routes: HTTP calls
frontend/src/api/client.js - HTTP client → Preview route: previews
frontend/src/api/client.js - HTTP client → Verification routes: verifies
frontend/src/api/client.js - HTTP client → Health route: checks health
frontend/src/api/client.js - FastAPI application → Manuscript routes: registers
backend/main.py - FastAPI application → Preview route: registers
backend/main.py - FastAPI application → Verification routes: registers
backend/main.py - FastAPI application → Health route: registers
backend/main.py - FastAPI application → Database sessions: initializes
backend/main.py - Manuscript routes → Pipeline orchestration: runs workflow
backend/api/manuscripts.py - Manuscript routes → Archive repository: archives records
backend/api/manuscripts.py - Preview route → Restoration pipeline: runs preview
backend/api/preview.py - Preview route → Image I/O: saves images
backend/api/preview.py - Pipeline orchestration → Restoration pipeline: restores image
backend/services/pipeline.py - Pipeline orchestration → Image I/O: loads and saves
backend/services/pipeline.py - Pipeline orchestration → Inference selection: transcribes image
backend/services/pipeline.py - Restoration pipeline → Restoration stages: dispatches stages
backend/services/restoration/pipeline.py - Inference selection → Line segmentation: segments lines
backend/services/transcription/inference.py - Inference selection → Local Qwen: selects locally
backend/services/transcription/inference.py - Inference selection → Colab client: selects remotely
backend/services/transcription/inference.py - Colab client → Colab inference server: sends inference request
- Verification routes → Archive repository: verifies draft
backend/api/transcriptions.py - Archive repository → SQLite archive: reads and writes
backend/services/archive/repository.py - Database sessions → SQLite archive: creates tables
backend/database/session.py - Manuscript routes → Database sessions: uses request session
backend/api/manuscripts.py - Verification routes → Database sessions: uses request session
backend/api/transcriptions.py - Inference selection → Runtime configuration: selects mode
backend/services/transcription/inference.py - Pipeline orchestration → Runtime configuration: reads settings
backend/services/pipeline.py - CER/WER evaluation → Archive repository: evaluates saved outputs