AI Sports Recap is a Streamlit-based application designed to generate video highlights and textual summaries of sports press conferences given a YouTube video link. The app leverages cutting-edge technologies including OpenAI's GPT-4o, Pegasus1 by TwelveLabs, and Docker for seamless integration and deployment.
- OpenAI GPT-4o: Used for generating textual summaries and extracting relevant video clips based on the input query.
- Pegasus1 by TwelveLabs: Utilized for transcript generation and video clipping.
- Streamlit: Provides the UI and frontend for user interaction.
- Docker: Ensures a consistent and reproducible environment for running the application.
- Transcript Generation: Automatically generates a transcript of the provided video.
- Highlight Extraction: Identifies and extracts key video segments that are relevant to the user's query.
- Summary Generation: Creates a concise summary of the press conference.
- Social Media Sharing: Allows users to share the generated summary and highlights on social media platforms.
- Docker
- OpenAI API Key
- TwelveLabs API Key
-
Clone the repository
git clone https://github.com/prateekchhikara/sports-highlights.git
-
Set up environment variables Create a
.env
file in the root directory and add your API keys:OPENAI_API_KEY=your_openai_api_key INDEX_ID=your_index_id TLABS=twelve-labs_api_key
-
Build and run the Docker container
docker compose up --build
-
Access the application Open your browser and go to
http://localhost:8501
.
- Enter the URL: Paste the YouTube video link of the press conference.
- Select an option: Choose from predefined video options if available.
- Submit a query: Input your question or query related to the video content.
- View the results: The app will display the video highlights and textual summary based on your query.
- Share on social media: Use the provided links to share the summary and highlights on Facebook and Twitter.
The main components of the application are as follows:
- Streamlit Frontend: Handles user input and displays results.
- Backend Functions:
generate_transcript
: Uses Pegasus1 to generate video transcripts.get_intervals
: Extracts relevant video segments based on the GPT-4o output.get_text_from_gpt
: Queries GPT-4o to extract relevant content & their timestamps from the generated transcripts based on the user's prompt.get_clippings_from_intervals
: Generates relevant clips of the original video based on the identified time intervals & merges them into a single highlight video.get_summary_and_title_from_gpt
: Generates a summary and title for the video content.
- Social Media Integration: Provides links for sharing the content on social media platforms.
-
User Interface:
- Enter the URL of the video or select from predefined options.
- Submit a question or query about the press conference.
-
Backend Processing:
- Generate transcript of the video.
- Use GPT-4o to summarize the transcript and identify key video segments.
- Clip the relevant video segments and generate a consolidated highlight video.
- Display the textual summary and video highlights to the user.
-
Sharing:
- Users can share the generated content on Facebook and Twitter directly from the app.
- OpenAI for their powerful GPT-4o model.
- TwelveLabs for Pegasus1 API.
- Streamlit for the user-friendly frontend framework.
- Docker for the containerization and ease of deployment.
Our project wouldn't be possible without the contributions of these amazing people! Thank you all for making this project better.