This project is an application for uploading multiple images, processing them with OCR (Optical Character Recognition) using Tesseract, and displaying the extracted text. It includes both a React frontend for the user interface and a FastAPI backend for processing images.
This project allows users to upload multiple images, which are then processed by the backend for OCR extraction using Tesseract. The backend returns the text extracted from the images, and the frontend displays the results.
- Frontend: React, JavaScript (ES6+)
- Backend: FastAPI, Python
- OCR: Tesseract (via pytesseract library)
- File Uploads: Multipart FormData
- Image Processing: PIL (Python Imaging Library)
- Styling: (Optional) CSS or other frontend libraries
- Node.js (v14.x or later)
- npm (Node Package Manager)
-
Clone the repository:
git clone <repository_url> cd <project_folder>
-
Install dependencies:
npm install
-
Start the React application:
npm start
The app will run on
http://localhost:3000by default.
The React app allows users to select and upload multiple image files. After submitting the images, the backend processes them with OCR and returns the extracted text. The frontend displays the results to the user.
- Python 3.7 or later
- pip (Python package installer)
-
Clone the repository:
git clone <repository_url> cd <project_folder>/backend
-
Create a virtual environment (optional but recommended):
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install dependencies:
pip install -r requirements.txt
-
Start the FastAPI server:
uvicorn main:app --reload
The FastAPI backend will run on
http://localhost:8000by default.
The FastAPI backend provides an endpoint to handle the upload of multiple image files. It processes these files with Tesseract OCR, extracting text and returning the results as JSON.
-
Run the Backend:
- Start the FastAPI server by running:
python -m uvicorn app:app --reload --port 5001
This will start the backend on
http://localhost:5001. -
Run the Frontend:
- Start the React development server by running:
npm run dev
This will start the frontend on
http://localhost:5174. -
Upload Images:
- Open the frontend in your browser (
http://localhost:5174). - Select multiple image files to upload.
- The backend will process each image, and the extracted text will be displayed on the frontend.
- Open the frontend in your browser (
This project is licensed under the MIT License - see the LICENSE file for details.