An AI-powered tool designed to generate imaginative prompts for abstract illustrations, inspired by the storytelling game Dixit. This project combines computer vision (CV) and natural language processing (NLP) techniques to create prompts that match the whimsical and abstract nature of the game.
- Extracts visual features from card images using CLIP (Contrastive Language–Image Pretraining).
- Generates creative, storytelling prompts with GPT-2, fine-tuned for the abstract art cards from the Dixit game
- Incorporates Reinforcement Learning with Human Feedback (RLHF) to refine prompts based on user input
- Interactive web app using Streamlit
- PyTorch: Backbone framework for implementing CLIP and GPT-2 models.
- Hugging Face Transformers: For working with pre-trained models like CLIP and GPT-2.
- Stable-Baselines3: For integrating reinforcement learning to enhance prompt generation.
- CLIP: To extract embeddings that align visual features with textual descriptions.
- OpenCV: For preprocessing images, including resizing, normalization, and augmentation.
- GPT-2: To generate abstract and creative prompts.
- SpaCy: For optional text preprocessing.
- Streamlit: To build an interactive app for users to upload images and receive prompts.
- Flask/FastAPI: For serving the model as an API.
- Docker: For containerizing the workflow to ensure reproducibility and scalability.
- Pandas: For managing datasets of images and corresponding prompts.
- JSON/CSV: For storing image-prompt annotations.
- Matplotlib/Seaborn: To visualize embeddings and analyze model performance.
- Plotly: For interactive visualizations (optional).
- Image Preprocessing: Resize and normalize card images using OpenCV.
- Feature Extraction: Use CLIP to generate image embeddings representing abstract visual features.
- Prompt Generation: Pass embeddings into GPT-3 to create creative, storytelling prompts.
- Feedback Loop: Collect human ratings for generated prompts and use RLHF to refine the model.
- Deployment: Package the workflow into a web app or API using Streamlit or Flask.
- Expand functionality to generate short stories for the prompts to emulate the Dixit game.
Install dependencies using pip:
pip install torch transformers opencv-python pandas streamlit flask