Giter Club home page Giter Club logo

ask-question-image-web-app-streamlit-langchain's Introduction

ask-question-image-web-app-streamlit-langchain

Watch the video
Watch on YouTube: Ask questions to an image using Python, Streamlit and Langchain !

This is a Streamlit application that allows users to ask questions about an uploaded image and receive responses from a conversational AI agent. The agent uses the OpenAI GPT-3.5 Turbo model to generate answers based on the provided image and user input.

installation

  1. Clone the repository:

     git clone https://github.com/your-username/image-question-answering.git
    
  2. Change to the project directory:

     cd  ask-question-image-web-app-streamlit-langchain
    
  3. Install the required dependencies:

     pip install -r requirements.txt
    
  4. Obtain an OpenAI API key. You can sign up for an API key at OpenAI.

  5. Replace the placeholder API key in the main.py file with your actual OpenAI API key:

     llm = ChatOpenAI(
         openai_api_key='YOUR_API_KEY',
         temperature=0,
         model_name="gpt-3.5-turbo"
     )
    
  6. Run the Streamlit application:

     streamlit run main.py
    
  7. Open your web browser and go to http://localhost:8501 to access the application.

usage

  1. Upload an image by clicking the file upload button.

  2. The uploaded image will be displayed.

  3. Enter a question about the image in the text input field.

  4. The conversational AI agent will generate a response based on the provided question and image.

  5. The response will be displayed below the question input.

tools

The application utilizes the following custom tools:

  • ImageCaptionTool: Generates a textual caption for the uploaded image.
  • ObjectDetectionTool: Performs object detection on the uploaded image and identifies the objects present.

contributing

Contributions are welcome! If you have any ideas, improvements, or bug fixes, please submit a pull request.

license

This project is licensed under the MIT License.

acknowledgements

This project uses the OpenAI GPT-3.5 Turbo model. Visit OpenAI for more information.

The Streamlit library is used for building the interactive user interface. Visit the Streamlit documentation for more information.

The LangChain library is used for managing the conversational AI agent and tools. Visit the LangChain GitHub repository for more information.

The Transformers library is used to inference the AI features. Visit this and this pages for a more comprehensive description of the models used.

ask-question-image-web-app-streamlit-langchain's People

Contributors

computervisioneng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.