ajitesh123 / AI-Stylist

OpenAI GPT-4 With Vision 🔥 This repository features an outfit rating app using OpenAI's GPT-4 with the Vision extension. Users can upload images through a Streamlit interface, and the app provides both a fashion stylist's and a mother's verdict on the outfit. Contributions are welcome!
MIT License
1 stars 0 forks source link

This pull request adds an Instagram caption generation feature to the… #12

Closed ajitesh123 closed 4 days ago

ajitesh123 commented 4 days ago

… existing outfit rating app. The main changes are:

  1. A new checkbox labeled "Generate Instagram Caption" has been added to the sidebar, below the image upload section. When this checkbox is checked, the app will use the existing OpenAI Vision API integration to generate an Instagram-style caption and hashtags for the uploaded outfit image.

  2. A new function generate_instagram_caption() has been added to the app.py file. This function takes an image as input and generates an Instagram-style caption and hashtags using the OpenAI API. The output is formatted in Markdown to ensure a visually appealing display.

  3. The make_dual_ai_calls() function has been updated to include a third thread for generating the Instagram caption. If the "Generate Instagram Caption" checkbox is checked, the function will call generate_instagram_caption() and store the result in the instagram_caption variable. If the checkbox is not checked, an empty string will be stored instead.

  4. In the main main() function, a new section titled "Instagram Caption" has been added below the existing "Fashion Stylist's Verdict" and "Mother's Verdict" sections. If the "Generate Instagram Caption" checkbox is checked, the generated caption and hashtags will be displayed in this new section using Markdown formatting. If an error occurs during the caption generation, an error message will be displayed instead.

This feature will allow users to easily generate an Instagram-ready caption for their outfit images, which can be useful for sharing on social media platforms.