This Python script utilizes the OpenAI GPT-4 API to analyze images, extract text, and categorize the content into Title, Body, and Footer. It is designed to process a given image, identify text regions, and categorize the text based on its position and context within the image.
Before you begin, ensure you have met the following requirements:
- You have a
Windows/Linux/Mac
machine. - You have installed the latest version of
Python
. - You have an OpenAI API key.
Clone the project repository to your local machine:
git clone https://github.com/Grant-Howard-32/SSDevOps.git
Navigate to the project directory:
cd SSDevOps
Use the package manager pip to install the required dependencies from requirements.txt:
pip install -r requirements.txt
Create a .env file in the project root directory and add your OpenAI API key:
OPENAI_API_KEY='Your-OpenAI-API-Key-Here'
Add images to the images directory.
Edit the following line in gptVision.py:
image_path = "images/[name of your image].jpg"
Run the script using Python:
python image_analysis_script.py
Contributions to this project are welcome. To contribute:
- Fork the repository.
- Create a new branch (git checkout -b feature/your_feature).
- Make your changes.
- Commit your changes (git commit -am 'Add some feature').
- Push to the branch (git push origin feature/your_feature).
- Create a new Pull Request.