https://github.com/livewithcodeankit/ai-ocr
Advanced AI-OCR with FastAPI and OpenAI Integration
https://github.com/livewithcodeankit/ai-ocr
ai ml ocr ocr-text-reader openai pydantic pytesseract-ocr python
Last synced: 4 months ago
JSON representation
Advanced AI-OCR with FastAPI and OpenAI Integration
- Host: GitHub
- URL: https://github.com/livewithcodeankit/ai-ocr
- Owner: LiveWithCodeAnkit
- Created: 2025-01-02T04:57:13.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-01-02T04:57:27.000Z (6 months ago)
- Last Synced: 2025-01-02T05:25:41.040Z (6 months ago)
- Topics: ai, ml, ocr, ocr-text-reader, openai, pydantic, pytesseract-ocr, python
- Language: Python
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📄 **Advanced AI-OCR with FastAPI and OpenAI Integration**
## 🚀 **Project Overview**
This project is an advanced Optical Character Recognition (OCR) API built using **FastAPI**. It leverages powerful image processing libraries such as **OpenCV**, **Pillow (PIL)**, and **pytesseract** to extract accurate text from images and PDFs, even with challenges like skewed, rotated, or noisy inputs. Additionally, **OpenAI** integration enhances text formatting and intelligent post-processing.---
## 🛠️ **Key Features**
1. **Multi-File Support:** Upload and process multiple images or PDFs simultaneously.
2. **Preprocessing Pipelines:** Noise reduction, deskewing, thresholding, and edge detection for improved OCR accuracy.
3. **Rotation & Skew Correction:** Automatically detect and fix image rotation and skewness.
4. **High OCR Accuracy:** Configurable `pytesseract` parameters for optimal text extraction.
5. **OpenAI Integration:** Intelligent text formatting and validation using OpenAI APIs.
6. **FastAPI Framework:** Efficient, scalable, and production-ready API services.---
## 📚 **Technologies Used**
- **FastAPI:** Backend framework for API development.
- **OpenCV:** Image processing and preprocessing.
- **Pillow (PIL):** Image manipulation.
- **pytesseract:** OCR engine.
- **NumPy:** Numerical operations.
- **OpenAI API:** Intelligent text formatting.
- **Pydantic:** Data validation.---
## 📥 **Installation & Setup**
1. Clone the repository:
```bash
git clone https://github.com/your-repo/ocr-api.git
cd ocr-apipython -m venv venv
pip install -r requirements.txt
venv\Scripts\activate
uvicorn main:app --reload