Git Product home page Git Product logo

sports-buddy's Introduction

Conversational AI with GPT-4 Vision, OpenAI Whisper, and TTS

Overview

This project integrates GPT-4 Vision, OpenAI Whisper, and OpenAI Text-to-Speech (TTS) to create an interactive AI system for conversations. It combines visual and audio inputs for a seamless user experience.

Demo Video:

https://twitter.com/ayushspai/status/1726222559480557647

Components

  • GPT-4 Vision: Analyzes visual input and generates contextual responses.
  • OpenAI Whisper: Converts spoken language into text.
  • OpenAI TTS: Transforms text responses into spoken language.

Main Files

  • main.py: Manages audio processing, image encoding, AI interactions, and text-to-speech output.
  • capture.py: Captures and processes video frames for visual analysis.

Installation

Prerequisites

  • Python 3.x
  • An OpenAI API key (set as an environment variable OPENAI_API_KEY)

Libraries

Install the necessary libraries with the requirements.txt file.

pip install -r requirements.txt

Usage

Running the Scripts

  • Start capture.py: Captures video frames and saves them for AI analysis.

    • Reads a video file, displays the video, and saves the current frame as frame.jpg.
    • Execute with python capture.py.
  • Run main.py concurrently: Orchestrates the conversational AI.

    • Continuously listens for user audio input.
    • Transcribes speech to text, captures the current video frame, and sends both to GPT-4 for analysis.
    • Converts the AI's response to speech and plays it back.
    • Execute with python main.py.

Workflow

  1. main.py listens for audio input and transcribes it using OpenAI Whisper.
  2. Meanwhile, capture.py captures a video frame.
  3. Both the audio transcription and the encoded image are sent to GPT-4 Vision.
  4. GPT-4 Vision responds, considering the visual and textual context.
  5. The response is vocalized using OpenAI TTS and played to the user.

Notes

  • Ensure both main.py and capture.py are active for the system to function.
  • The video file in capture.py can be customized.
  • Adequate hardware is recommended for smooth audio and video processing.

Conclusion

This project demonstrates a novel approach to combining various AI technologies, creating a dynamic and interactive conversational AI experience. It harnesses the capabilities of GPT-4 Vision, Whisper, and TTS for a comprehensive audio-visual interaction.

sports-buddy's People

Contributors

ayushpai 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.