Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,51 +1,51 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
This repository contains the complete code and tutorials for implementing a multimodal retrieval-augmented generation (RAG) system capable of processing, storing, and retrieving video content. The system uses BridgeTower for multimodal embeddings, LanceDB as the vector store, and Pixtral as the conversation LLM.
|
| 5 |
|
| 6 |
-
|
| 7 |
-
To install the necessary dependencies, run the following command:
|
| 8 |
-
```bash
|
| 9 |
-
pip install -r requirements.txt
|
| 10 |
-
```
|
| 11 |
|
| 12 |
-
##
|
| 13 |
-
1. `mm_rag.ipynb`: Complete end-to-end implementation of the multimodal RAG system
|
| 14 |
-
2. `embedding_creation.ipynb`: Deep dive into generating multimodal embeddings using BridgeTower
|
| 15 |
-
3. `vector_store.ipynb`: Detailed guide on setting up and populating LanceDB for vector storage
|
| 16 |
-
4. `preprocessing_video.ipynb`: Comprehensive coverage of video preprocessing techniques, including:
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
-
##
|
| 24 |
-
You'll need to set up the following API keys:
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
|
| 28 |
-
##
|
| 29 |
-
The tutorial uses a sample video about a space expedition. You can replace it with any video of your choice, but make sure to:
|
| 30 |
|
| 31 |
-
*
|
| 32 |
-
*
|
| 33 |
-
*
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
##
|
| 36 |
-
Contributions are welcome! Some areas for improvement include:
|
| 37 |
|
| 38 |
-
|
| 39 |
-
* Prompt engineering refinements
|
| 40 |
-
* Alternative retrieval strategies
|
| 41 |
-
* Testing different VLMs and embedding models
|
| 42 |
|
| 43 |
-
|
| 44 |
-
1. Fork the repository.
|
| 45 |
-
2. Create a new branch (`git checkout -b feature-branch`).
|
| 46 |
-
3. Commit your changes (`git commit -am 'Add new feature'`).
|
| 47 |
-
4. Push to the branch (`git push origin feature-branch`).
|
| 48 |
-
5. Create a new Pull Request.
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Multimodal RAG Video Chat
|
| 3 |
+
emoji: 🎬
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: red
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: apache-2.0
|
| 11 |
+
---
|
| 12 |
|
| 13 |
+
# 🎬 Multimodal RAG Video Chat
|
|
|
|
| 14 |
|
| 15 |
+
An interactive application that allows you to chat with YouTube videos using advanced multimodal retrieval-augmented generation (RAG).
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
## Features
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
- **Video Processing**: Automatically downloads and processes YouTube videos
|
| 20 |
+
- **Multimodal Embeddings**: Uses BridgeTower for joint text-image understanding
|
| 21 |
+
- **Vector Storage**: Stores embeddings in LanceDB for efficient retrieval
|
| 22 |
+
- **Visual Language Model**: Powered by Pixtral for intelligent responses
|
| 23 |
+
- **Interactive Interface**: Chat interface with retrieved video frames display
|
| 24 |
|
| 25 |
+
## How to Use
|
|
|
|
| 26 |
|
| 27 |
+
1. **Load Video**: Paste a YouTube URL and click "Process Video"
|
| 28 |
+
2. **Chat**: Ask questions about the video content
|
| 29 |
+
3. **View Results**: See relevant video frames alongside AI responses
|
| 30 |
|
| 31 |
+
## Technology Stack
|
|
|
|
| 32 |
|
| 33 |
+
- **Frontend**: Gradio
|
| 34 |
+
- **Embeddings**: BridgeTower (multimodal)
|
| 35 |
+
- **Vector DB**: LanceDB
|
| 36 |
+
- **LLM**: Pixtral-12B (Mistral AI)
|
| 37 |
+
- **Video Processing**: OpenCV, pytube
|
| 38 |
|
| 39 |
+
## Setup
|
|
|
|
| 40 |
|
| 41 |
+
You'll need a Mistral AI API key to use this application. Add it as a secret named `MISTRAL_API_KEY`.
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
## Architecture
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
+
The system follows a RAG (Retrieval-Augmented Generation) approach:
|
| 46 |
+
1. Videos are processed into frames and transcripts
|
| 47 |
+
2. Multimodal embeddings are created and stored
|
| 48 |
+
3. User queries retrieve relevant video segments
|
| 49 |
+
4. Visual language model generates contextual responses
|
| 50 |
+
|
| 51 |
+
Check out the [GitHub repository](https://github.com/daddyofadoggy/multimodal-rag) for more details.
|