YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

SIH OCR Studio

High-Performance Windows Desktop Application for Offline Document OCR & Text Extraction
Powered by JavaFX 21, Python 3.12, Tesseract OCR v5, PyMuPDF, OpenCV, and FastAPI.

SIH OCR Studio provides an offline desktop experience for converting scanned images and multi-page PDF documents into editable, structured text with full support for Hindi (Devanagari), English, and bilingual Hindi+English documents.


๐Ÿ“ธ Key Capabilities & UI Layout

SIH OCR Studio implements a clean and high-performance desktop architecture:

+-----------------------------------------------------------------------------------------------+
|  SIH OCR | Studio          [Engine: Tesseract OCR] [Engine Loaded โœ“] [Lang: Hindi + English]  |
|  [๐Ÿ“ Open File]  dh2efile.pdf   [< Prev] [Page: 1/12] [Next >]  [Zoom +/-] [Fit] [Rotate]     |
+-----------------------------------------------+-----------------------------------------------+
|                                               |  Output: [Markdown] [HTML] [JSON]  [Copy]     |
|              DOCUMENT PREVIEW                 |  -------------------------------------------  |
|                                               |  OCR Result                                   |
|   โ€ข High-fidelity rendering (PyMuPDF)         |  File: dh2efile.pdf                           |
|   โ€ข Interactive zoom, pan & rotation          |  Page: 1/12 | Lines: 18 | Words: 140          |
|   โ€ข Drag-and-drop file upload                 |  Confidence: 94.8%                            |
|   โ€ข Image & PDF text-layer inspection         |  -------------------------------------------  |
|   โ€ข Multi-page navigation                     |  เคคเคฎเคฟเคฒเคจเคพเคกเฅ เค•เฅ€ เคฐเคพเคœเคจเฅ€เคคเคฟ เคฎเฅ‡เค‚ เคธเคฐเค•เคพเคฐ เค—เค เคจ เค•เฅ‹         |
|                                               |  เคฒเฅ‡เค•เคฐ เคนเคฒเคšเคฒ เคคเฅ‡เคœเคผ เคนเฅ‹ เค—เคˆ เคนเฅˆ...                   |
+-----------------------------------------------+-----------------------------------------------+
|  [โ–ถ Run OCR]  [โšก OCR All Pages]  [โน Stop]     |  [Copy Text] [Export DOCX] [Export TSV]       |
|  Time: 1.4s | Progress: [==========] 100%     |  [Export TXT] [Export JSON] [Export HTML]     |
+-----------------------------------------------+-----------------------------------------------+
|  Ready | Backend: Online โœ“ (127.0.0.1:8000)                                                   |
+-----------------------------------------------------------------------------------------------+

Core Features:

  • Offline & Private: All processing occurs locally on 127.0.0.1. No internet access required. No data leaves the machine.
  • Multilingual OCR Engine: Native Tesseract OCR integration with multi-script support:
    • English (eng)
    • Hindi (hin)
    • Hindi + English (hin+eng)
    • Dynamic detection of 160+ installed Tesseract language packs.
  • Multi-Page PDF Processing:
    • Fast page navigation and progressive on-demand page rendering at 150-300 DPI.
    • Hybrid text-layer detection: instantly extract embedded digital text or perform full OCR.
    • Sequential batch processing with cancellation checkpoints.
  • Image Preprocessing Pipeline (OpenCV & Pillow):
    • Automatic deskewing (rotational alignment).
    • Noise reduction (bilateral filtering).
    • Contrast enhancement (CLAHE).
    • Adaptive thresholding (binarization).
    • Upscaling for fine/small typography.
    • Invert colors mode for dark background documents.
  • Output Views & Formats:
    • Markdown Tab: Clean readable plain text with preserved paragraphs and Devanagari Unicode.
    • HTML Tab: Structured, safe semantic HTML output.
    • JSON Tab: Word-level positions, line indices, bounding boxes, and confidence statistics.
  • Export Formats:
    • Microsoft Word (DOCX)
    • Tab-Separated Values (TSV)
    • Plain Text (TXT)
    • Structured JSON
    • Webpage (HTML)
    • Markdown (MD)

๐Ÿ› ๏ธ Technology Stack

Layer Component Description
Frontend UI JavaFX 21 Native desktop UI, GPU-accelerated rendering, Segoe UI & Devanagari typography.
Build System Maven 3.9 Dependency management, JavaFX packaging, shaded fat JAR creation.
Backend Engine Python 3.12 (FastAPI) High-throughput asynchronous local service bound strictly to 127.0.0.1.
OCR Engine Tesseract OCR v5.5 Industrial OCR engine with neural network (LSTM) recognition.
PDF Processing PyMuPDF (fitz) High-fidelity rendering and vector text-layer extraction.
Image Pipeline OpenCV & Pillow Geometric correction, filtering, and thresholding.
Export Service python-docx & csv Native Microsoft Word DOCX and TSV generation.

๐Ÿš€ Quick Start on Windows

1. One-Click Setup

Open PowerShell in the workspace root and run:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\scripts\setup_windows.ps1

2. Launch the Desktop Application

Double-click run.bat or run in Command Prompt / PowerShell:

.\run.bat

Or via PowerShell script:

.\scripts\run_windows.ps1

3. Build & Package

To produce a standalone Windows package:

.\scripts\build_windows.ps1

๐Ÿ”Œ Local API Endpoints (127.0.0.1:8000)

The application uses an internal REST API for decoupled Java-to-Python communication:

  • GET /api/health: Health status, Tesseract availability, version, and language pack check.
  • GET /api/languages: Dynamic list of available installed OCR languages.
  • POST /api/document/info: Document inspection (type, format, dimensions, page count, text-layer presence).
  • GET /api/document/preview: Render document page preview at specified DPI (PNG stream).
  • POST /api/ocr: Submit OCR job (single page, multi-page, or text-layer auto).
  • GET /api/jobs/{job_id}: Track progress (0.0 to 1.0, current page, elapsed time).
  • GET /api/jobs/{job_id}/results: Retrieve completed OCR text, stats, and words metadata.
  • POST /api/jobs/{job_id}/cancel: Request safe cancellation between pages.
  • POST /api/export: Export results to DOCX, TSV, TXT, JSON, HTML, or MD.
  • POST /api/settings/update: Dynamically update and re-test Tesseract executable path.

๐Ÿงช Automated Test Suite

Both backend and frontend components have comprehensive automated test suites:

1. Backend Pytest Suite

Run with:

.venv\Scripts\python.exe -m pytest backend/tests

Results: 8 passed in 4.71s

  • test_health_endpoint
  • test_languages_endpoint
  • test_document_processor_inspect
  • test_pdf_rendering
  • test_image_preprocessing
  • test_ocr_engine_execution
  • test_api_ocr_flow
  • test_exports (TXT, DOCX, TSV, JSON, MD, HTML)

2. Java Frontend Unit Tests

Run with:

.\tools\maven\bin\mvn.cmd test -f frontend/pom.xml

Results: Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

  • testAppSettingsDefaults
  • testDocumentInfoModel
  • testOcrResultSerialization (Unicode Hindi Devanagari serialization test)

๐Ÿ“ Project Structure

sih-ocr-studio/
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ run.bat
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ config.py
โ”‚   โ”œโ”€โ”€ document_processor.py
โ”‚   โ”œโ”€โ”€ export_service.py
โ”‚   โ”œโ”€โ”€ image_preprocessing.py
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ”œโ”€โ”€ ocr_engine.py
โ”‚   โ”œโ”€โ”€ requirements.txt
โ”‚   โ”œโ”€โ”€ result_formatter.py
โ”‚   โ””โ”€โ”€ tests/
โ”‚       โ””โ”€โ”€ test_backend.py
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ pom.xml
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ main/
โ”‚       โ”‚   โ”œโ”€โ”€ java/com/sihocr/
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ Launcher.java
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ MainApp.java
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ controllers/
โ”‚       โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ MainController.java
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ models/
โ”‚       โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AppSettings.java
โ”‚       โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ DocumentInfo.java
โ”‚       โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ OcrFullResult.java
โ”‚       โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ OcrJobStatus.java
โ”‚       โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ OcrPageResult.java
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ services/
โ”‚       โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ BackendProcessManager.java
โ”‚       โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ OcrApiClient.java
โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ views/
โ”‚       โ”‚   โ”‚       โ”œโ”€โ”€ AboutDialog.java
โ”‚       โ”‚   โ”‚       โ”œโ”€โ”€ InstructionsDialog.java
โ”‚       โ”‚   โ”‚       โ””โ”€โ”€ SettingsDialog.java
โ”‚       โ”‚   โ””โ”€โ”€ resources/
โ”‚       โ”‚       โ””โ”€โ”€ css/
โ”‚       โ”‚           โ”œโ”€โ”€ styles.css
โ”‚       โ”‚           โ””โ”€โ”€ dark.css
โ”‚       โ””โ”€โ”€ test/
โ”‚           โ””โ”€โ”€ java/com/sihocr/
โ”‚               โ””โ”€โ”€ ModelsAndSettingsTest.java
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ build_windows.ps1
โ”‚   โ”œโ”€โ”€ run_windows.ps1
โ”‚   โ””โ”€โ”€ setup_windows.ps1
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ INSTALLATION.md
โ”‚   โ””โ”€โ”€ TROUBLESHOOTING.md
โ””โ”€โ”€ tools/
    โ”œโ”€โ”€ jdk-21/
    โ””โ”€โ”€ maven/
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support