🚀 High-performance OCR API for extracting text from images and PDFs
Built using FastAPI, OpenCV, and Tesseract OCR, and deployed with Docker on Render
Shayak AI OCR is a production-ready document processing system designed to convert unstructured visual data (images and PDFs) into clean, machine-readable text.
It combines image preprocessing techniques with Tesseract OCR to achieve reliable text extraction across real-world inputs.
The system is exposed as a REST API and integrated with a live frontend.
Frontend
https://ocr-sipg.vercel.app/
API Base URL
https://ocr-api-opk6.onrender.com
API Documentation
https://ocr-api-opk6.onrender.com/docs
📸 Image OCR — Extract text from images and scanned documents
📄 PDF OCR — Multi-page PDF text extraction
🧠 Smart Preprocessing — Resizing, denoising, thresholding
🌍 Multi-language Support — English + Hindi
🧹 Text Cleaning — Removes noise and fixes OCR errors
⚡ FastAPI Backend — High-performance REST API
🐳 Docker Deployment — Production-ready containerized setup
🌐 Cloud Hosted — Public API with real-world usability
Category Technology
Language Python
Framework FastAPI
Image Processing OpenCV
OCR Engine Tesseract OCR
PDF Handling pdf2image
Data Handling NumPy
Text Processing Regex
OCR/ │ ├── Backend/ │ ├── main.py # FastAPI entry point │ ├── ocr_engine.py # API-OCR bridge │ ├── ocr/ │ ├── preprocess.py # Image preprocessing │ ├── extract.py # OCR execution │ ├── utils.py # Text cleaning │ ├── pipeline.py # Full pipeline │ ├── frontend/ # UI (Vercel deployed) │ ├── index.html │ ├── script.js │ ├── style.css │ ├── Dockerfile # Deployment configuration ├── requirements.txt
git clone https://github.com/HarshMisra1102/OCR.git
cd OCR
pip install -r requirements.txt
uvicorn Backend.main:app --reload --port 8001
POST /scan
curl -X POST https://ocr-api-opk6.onrender.com/scan
-F "file=@sample.pdf"
{ "text": "Extracted text here..." }
Input (Image/PDF)
↓
Preprocessing (Resize + Denoise + Threshold)
↓
OCR (Tesseract Engine)
↓
Text Cleaning & Correction
↓
Final Output (JSON)
🎯 Accuracy: 85–90% on clean documents
⚡ Processing Time: ~1 second per image
📄 Supports: Images and multi-page PDFs
Backend
- Dockerized FastAPI service
- Deployed on Render
Frontend
- Static UI deployed on Vercel
- Handling noisy and low-quality images
- Improving OCR accuracy via preprocessing
- Supporting multi-page PDF extraction
- Reducing common OCR recognition errors
📐 Automatic document detection and cropping
🌍 Expanded multi-language OCR support
⚡ Async processing for scalability
🧾 Structured data extraction (tables, forms, resumes)
Harsh Misra
Backend Developer | OCR Engineer
Built as part of an AI-powered system — Shayak AI
This project demonstrates:
- Real-world problem solving using computer vision
- Integration of image processing and OCR systems
- End-to-end API design and deployment
- Production-ready backend engineering practices
Open-source for learning and development purposes