SansG2003/GOT_OCR2.0
0
OCR and Document Search Application
This application allows users to upload images containing text in Hindi and English, extract the text using OCR (Optical Character Recognition), and then search for keywords within the extracted text.
Table of Contents
- Prerequisites
- Setting Up the Environment
- Running the Application Locally
- Deployment Process
- Usage
- Troubleshooting
Prerequisites
- Python 3.7 or higher
- CUDA-capable GPU (for optimal performance)
Setting Up the Environment
- Create a virtual environment:
python -m venv venv- Activate the virtual environment:
- On Windows:
venv\Scripts\activate- On macOS and Linux:
source venv/bin/activate- Install the required packages:
pip install -r requirements.txtRunning the Application Locally
- Ensure your virtual environment is activated.
- Run the application:
python app.py- Open your web browser and navigate to the URL displayed in the console (typically
http://127.0.0.1:7860).
Deployment Process
To deploy this application to a production environment, follow these steps:
- Choose a hosting platform (e.g., Heroku, Google Cloud Platform, AWS).
- Set up a new project/application on your chosen platform.
- Configure the environment variables required by your application.
- Set up a requirements.txt file if not already present.
- If using a platform like Heroku, create a
Procfilewith the following content:
web: python app.py- Deploy your application using the platform-specific deployment process.
Note: Ensure that your chosen platform supports GPU acceleration if required for optimal performance.
Usage
- Upload an image containing text in Hindi or English.
- Click the "Extract Text" button to perform OCR on the image.
- Enter a keyword in the search box.
- Click the "Search" button to find and highlight occurrences of the keyword in the extracted text.
- Use the "Clear" button to reset all inputs and results.
Troubleshooting
- If you encounter CUDA-related errors, ensure that your CUDA drivers are up to date and compatible with the installed PyTorch version.
- If the application crashes when uploading images, check that you have the latest version of Gradio installed.
- For any other issues, check the console output for error messages and refer to the documentation of the libraries used (Gradio, Transformers, PyTorch).
For further assistance, please open an issue on the GitHub repository.
