This project is a Python script that generates descriptions for a list of meme images using OpenAI's API. The script processes the images, generates descriptions, and creates a document with the descriptions.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You need Python 3.8 or later to run the script. You can have multiple Python versions (2.x and 3.x) installed on the same system without problems.
In Ubuntu, Mint and Debian you can install Python 3 like this:
sudo apt-get install python3 python3-pip
For other Linux flavors, macOS and Windows, packages are available at
The first step is to clone the repository:
git clone https://github.com/Ale4224/meme_descriptor.git
Navigate to the project directory:
cd meme_descriptor
Install the dependencies:
pip install -r requirements.txt
The script uses the following environment variables:
OPENAI_API_KEY
: Your OpenAI API key. This is required to make requests to the OpenAI API for generating meme descriptions.USE_LOCAL_IMAGES
: A boolean value (true
orfalse
). If set totrue
, the script will use local images for generating meme descriptions. Iffalse
, it will use the URLs specified inmeme_urls.py
.NUMBER_OF_MEMES_TO_GENERATE
: The number of memes for which the script should generate descriptions. It should be a positive integer.MOCK_DATA
: A boolean value (true
orfalse
). If set totrue
, the script will use mock datamockdata.json
for generating the meme descriptions. This can be useful for testing purposes.SAVE_MOCK_DATA
: A boolean value (true
orfalse
). If set totrue
, the script will save the generated descriptions as mock data in tthe filemockdata.json
. This can be useful for future testing purposes.
These variables should be set in a .env
file in the root directory of the project.
To run the script, you can use the following command:
python src/main.py
- Python 3 - The programming language used.
- OpenAI API - The API used to generate descriptions.
- mdutils - A Python library used to create Markdown files programmatically.
- Alessandro Tassinari - Initial work - Ale4224
This project is licensed under the MIT License - see the LICENSE.md file for details
This project is a gift to my sister, who is trying to learn the python programming language.