HaithamIsmail
commited on
Commit
Β·
7835c3b
1
Parent(s):
77411b3
added readme
Browse files
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
title: Clip Search Agent
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: pink
|
| 6 |
sdk: gradio
|
|
@@ -8,7 +8,153 @@ sdk_version: 5.33.0
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
|
|
|
|
|
|
| 11 |
short_description: An agent that allows chatting with parts of video
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Clip Search Agent
|
| 3 |
+
emoji: π¬
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: pink
|
| 6 |
sdk: gradio
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
| 11 |
+
tags:
|
| 12 |
+
- agent-demo-track
|
| 13 |
short_description: An agent that allows chatting with parts of video
|
| 14 |
---
|
| 15 |
|
| 16 |
+
Excellent point. A good README must include the setup instructions. I will generate a `requirements.txt` file based on the library imports in your Python scripts and then integrate it into a more complete "Getting Started" section in the README.
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
### 1. `requirements.txt`
|
| 21 |
+
|
| 22 |
+
Based on a thorough analysis of `video_pipeline.py` and `app.py`, here is the consolidated `requirements.txt` file.
|
| 23 |
+
|
| 24 |
+
```txt
|
| 25 |
+
# Core Libraries
|
| 26 |
+
openai
|
| 27 |
+
gradio
|
| 28 |
+
pandas
|
| 29 |
+
numpy
|
| 30 |
+
lancedb
|
| 31 |
+
langchain-openai
|
| 32 |
+
langchain-core
|
| 33 |
+
huggingface_hub
|
| 34 |
+
Pillow
|
| 35 |
+
scikit-learn
|
| 36 |
+
nltk
|
| 37 |
+
sentence-transformers
|
| 38 |
+
tqdm
|
| 39 |
+
|
| 40 |
+
# Optional, but recommended for full functionality
|
| 41 |
+
pydantic-settings # Assuming this is used by your config.py
|
| 42 |
+
python-dotenv # Also common for config management
|
| 43 |
+
```
|
| 44 |
+
**Note:** The user's `config.py` likely uses `pydantic-settings` or `python-dotenv` to manage secrets. I've included them as recommended packages.
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
### 2. `packages.txt` (for system-level dependencies)
|
| 49 |
+
|
| 50 |
+
This is crucial for environments like Docker or cloud deployments where you need to install system packages. Based on the use of `ffmpeg` and some common Python library dependencies:
|
| 51 |
+
|
| 52 |
+
```txt
|
| 53 |
+
# System dependencies for media processing and building Python packages
|
| 54 |
+
ffmpeg
|
| 55 |
+
build-essential
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
---
|
| 59 |
+
|
| 60 |
+
### 3. Updated README.md
|
| 61 |
+
|
| 62 |
+
Here is the revised README that incorporates these setup instructions into a comprehensive "Getting Started" section.
|
| 63 |
+
|
| 64 |
+
---
|
| 65 |
+
|
| 66 |
+
# π¬ HyperClipper: Your AI Video Librarian π€
|
| 67 |
+
|
| 68 |
+
Tired of scrubbing through hours of video to find that *one* perfect moment? HyperClipper is your personal AI video librarian that watches, understands, and catalogs your entire video library, making every second instantly searchable.
|
| 69 |
+
|
| 70 |
+
<br>
|
| 71 |
+
|
| 72 |
+
## β¨ What It Does
|
| 73 |
+
|
| 74 |
+
HyperClipper ingests your videos and uses a sophisticated AI pipeline to automatically:
|
| 75 |
+
|
| 76 |
+
- **ποΈ Watch Everything:** It analyzes video frames to detect scene changes and logical breaks.
|
| 77 |
+
- **π Listen to Conversations:** It transcribes all spoken dialogue with pinpoint accuracy.
|
| 78 |
+
- **π§ Understand Content:** It combines visual and audio context to generate rich, meaningful summaries for each detected clip.
|
| 79 |
+
- **ποΈ Create a Smart Index:** It stores everything in a high-speed vector database, turning your video content into a searchable knowledge base.
|
| 80 |
+
|
| 81 |
+
The result? A powerful, conversational AI agent you can chat with to find exactly what you're looking for, instantly.
|
| 82 |
+
|
| 83 |
+
<br>
|
| 84 |
+
|
| 85 |
+
## π Key Features
|
| 86 |
+
|
| 87 |
+
* **Conversational Search:** Just ask! "Find clips where they discuss Qwen models" or "Show me the part about cooking pasta."
|
| 88 |
+
* **Multimodal Understanding:** The agent doesn't just search text; it understands the *content* of the clips, leveraging both visuals and audio.
|
| 89 |
+
* **Instant Previews:** See search results with summaries, relevance scores, and playable video clips directly in the chat.
|
| 90 |
+
* **Drop-and-Go Analysis:** Simply upload a new video, and HyperClipper automatically processes and adds it to your searchable library.
|
| 91 |
+
|
| 92 |
+
<br>
|
| 93 |
+
|
| 94 |
+
## π οΈ Getting Started
|
| 95 |
+
|
| 96 |
+
Follow these steps to set up and run HyperClipper on your local machine.
|
| 97 |
+
|
| 98 |
+
### Step 1: System Dependencies
|
| 99 |
+
|
| 100 |
+
This project requires `ffmpeg` for video and audio processing. Install it using your system's package manager.
|
| 101 |
+
|
| 102 |
+
* **On macOS (using Homebrew):**
|
| 103 |
+
```bash
|
| 104 |
+
brew install ffmpeg
|
| 105 |
+
```
|
| 106 |
+
* **On Debian/Ubuntu:**
|
| 107 |
+
```bash
|
| 108 |
+
sudo apt-get update && sudo apt-get install ffmpeg
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
### Step 2: Clone the Repository
|
| 112 |
+
|
| 113 |
+
```bash
|
| 114 |
+
git clone https://huggingface.co/spaces/Agents-MCP-Hackathon/Clip-Search-Agent/
|
| 115 |
+
cd Clip-Search-Agent # or your project directory name
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
### Step 3: Install Python Packages
|
| 119 |
+
|
| 120 |
+
Create a virtual environment and install the required Python libraries.
|
| 121 |
+
|
| 122 |
+
```bash
|
| 123 |
+
# Create a virtual environment
|
| 124 |
+
python3 -m venv venv
|
| 125 |
+
source venv/bin/activate
|
| 126 |
+
|
| 127 |
+
# Install all dependencies
|
| 128 |
+
pip install -r requirements.txt
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
### Step 4: Configure Environment Variables
|
| 132 |
+
|
| 133 |
+
Create a `.env` file in the root of the project directory and add your API keys and model endpoints. Your `config.py` will load these variables.
|
| 134 |
+
|
| 135 |
+
```env
|
| 136 |
+
# .env file
|
| 137 |
+
HF_API_KEY="hf_..."
|
| 138 |
+
NEBIUS_API_KEY="your_nebius_key"
|
| 139 |
+
MODAL_VLM_URL="https://your-modal-endpoint-url..."
|
| 140 |
+
# ... add any other secrets or configuration variables here
|
| 141 |
+
```
|
| 142 |
+
|
| 143 |
+
### Step 5: Launch the Application
|
| 144 |
+
|
| 145 |
+
With all dependencies installed and configurations set, launch the Gradio web server.
|
| 146 |
+
|
| 147 |
+
```bash
|
| 148 |
+
gradio app.py
|
| 149 |
+
```
|
| 150 |
+
You should see a message like `π Starting Video Search Agent...` and a local URL (e.g., `http://127.0.0.1:7860`). Open this URL in your browser.
|
| 151 |
+
|
| 152 |
+
### Step 6: Analyze & Search
|
| 153 |
+
|
| 154 |
+
1. Navigate to the **"Video Analyzer"** tab in the web UI.
|
| 155 |
+
2. Upload your first video file and click "Analyze Video".
|
| 156 |
+
3. Once processing is complete, go to the **"Chat with Clips"** tab and start a conversation with your new AI video librarian!
|
| 157 |
+
|
| 158 |
+
---
|
| 159 |
+
|
| 160 |
+
**HyperClipper: Don't just watch your videos. Understand them.**
|