This project is a web application for Optical Character Recognition (OCR) using PaddleOCR and Streamlit. It allows users to upload an image and extract text from it in multiple languages with confidence scores.
- Support for multiple languages (currently English and Arabic).
- Displays uploaded image.
- Extracts and displays text with confidence scores.
- Provides an option to visualize OCR results on the image.
- Streamlit: An open-source app framework for Machine Learning and Data Science.
- PaddleOCR: A rich repository for OCR models.
- OpenCV: A library for computer vision tasks.
- NumPy: A library for numerical computations.
- PIL (Pillow): A library for image processing.
-
Clone the repository:
git clone https://github.com/Ansarimajid/OCR.git cd OCR
-
Install the required packages:
pip install -r requirements.txt
-
Download the required PaddleOCR models:
paddleocr --lang en # for English paddleocr --lang ar # for Arabic (if needed)
-
Run the Streamlit application:
streamlit run app.py
-
Open your web browser and go to
http://localhost:8501
. -
Select the language from the sidebar.
-
Upload an image in PNG, JPG, or JPEG format.
-
View the uploaded image and the extracted text with confidence scores.
-
Optionally, visualize the OCR results on the image by checking the "Draw OCR Results on Image" checkbox.
app.py
: Main application file.requirements.txt
: Contains the list of Python packages required for the project.README.md
: Project documentation.temp_img.jpg
: Temporary image file created during OCR processing.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for more details.