This is a Python demo proof of concept project that uses EasyOCR and OpenAI to extract specific information from an image and format it into a specific structure.
Before you begin, ensure that you have the latest version of Python installed. We recommend Python 3.7 or later. You can verify your Python installation by using the following command:
python --version
To install the necessary libraries for this project, use pip, which is a package manager for Python.
Use the following commands to install the required libraries:
pip install openai
pip install easyocr
pip install rich
After you have installed the necessary libraries, you can run the Python script with the following command:
python main.py
Before running the script, make sure to replace the openai_key
in main
function with your actual OpenAI key and file_path
with the path to the image file you want to process.
The script reads an image, applies OCR to extract text data, formats the text data into a structure as defined by the OCRResult
dataclass, and then prints this structured information.
This project is licensed under the terms of the MIT license.
For any issues or suggestions related to this project, please open an issue on this GitHub repository. Contributions are always welcome.
This project uses OpenAI and EasyOCR libraries to process images and extract textual information. We express our gratitude to the developers of these libraries.