Spaces:
Running
A newer version of the Streamlit SDK is available:
1.40.1
title: GOT OCR
emoji: π
colorFrom: green
colorTo: indigo
sdk: streamlit
sdk_version: 1.38.0
app_file: app.py
pinned: false
license: mit
Image Text OCR using GOT (General OCR Theory)
This Streamlit application provides an interface for Optical Character Recognition (OCR) using the GOT (General OCR Theory) model. Users can upload images, and the application will extract text from them. Additionally, it includes a search feature to highlight specific words or phrases in the extracted text.
Demo
Try out the live demo on huggingface: GOT-OCR-Space
Setup
Clone this repository to your local machine.
Ensure you have Python 3.7+ installed.
Install the required dependencies:
pip install -r requirements.txt
Usage
To run the application locally:
streamlit run app.py
Then, open your web browser and navigate to the URL provided by Streamlit (usually http://localhost:8501
).
Features
- Image upload: Supports JPG, PNG, and JPEG formats.
- Text extraction: Uses the GOT model to extract text from uploaded images.
- Search functionality: Allows users to search for specific words or phrases in the extracted text, highlighting the matches.
Model Information
This application uses the CPU version of the GOT (General OCR Theory) model. The model is loaded from the Hugging Face model hub:
- Model:
srimanth-d/GOT_CPU
- Tokenizer:
srimanth-d/GOT_CPU
While the code includes functions for GPU model initialization, the deployed version uses the CPU model due to limitations in the Hugging Face deployment environment. This may result in slower processing times but ensures compatibility across different deployment scenarios.
Note on Performance
The use of the CPU model might lead to slower processing times compared to a GPU-enabled version. However, this trade-off ensures that the application can run in environments without GPU support, such as the Hugging Face deployment platform.
Additional Information
- The application creates a directory named
images
to temporarily store uploaded images. - The search functionality is case-insensitive and highlights all occurrences of the search term in the extracted text.