Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -51,75 +51,59 @@ model-index:
|
|
| 51 |
|
| 52 |
# π¬ ZenVision AI Subtitle Generator
|
| 53 |
|
| 54 |
-
**
|
| 55 |
|
| 56 |
-
ZenVision
|
| 57 |
|
| 58 |
-
## π
|
| 59 |
|
| 60 |
-
###
|
| 61 |
-
- **Whisper Large-v2**:
|
| 62 |
-
- **BERT Multilingual**:
|
| 63 |
-
- **RoBERTa Sentiment**:
|
| 64 |
-
- **DistilRoBERTa Emotions**:
|
| 65 |
-
- **Helsinki
|
| 66 |
-
- **spaCy + NLTK
|
| 67 |
|
| 68 |
-
###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|------------|--------|---------|
|
| 72 |
-
| Whisper Large-v2 | 1.5 GB | TranscripciΓ³n de audio |
|
| 73 |
-
| BERT Multilingual | 400 MB | Embeddings contextuales |
|
| 74 |
-
| RoBERTa Sentiment | 200 MB | AnΓ‘lisis de sentimientos |
|
| 75 |
-
| DistilRoBERTa Emotions | 300 MB | DetecciΓ³n de emociones |
|
| 76 |
-
| Translation Models | 500 MB | TraducciΓ³n multiidioma |
|
| 77 |
-
| NLP Components | 300 MB | Procesamiento de texto |
|
| 78 |
-
| **TOTAL** | **~3.2 GB** | **Sistema completo** |
|
| 79 |
-
|
| 80 |
-
### π― Capacidades
|
| 81 |
-
|
| 82 |
-
- **TranscripciΓ³n**: 90+ idiomas con precisiΓ³n del 95%+
|
| 83 |
-
- **TraducciΓ³n**: 10+ idiomas de destino
|
| 84 |
-
- **AnΓ‘lisis Emocional**: 7 emociones bΓ‘sicas detectadas
|
| 85 |
-
- **Formatos de Salida**: SRT, VTT, JSON con metadatos
|
| 86 |
-
- **Procesamiento en Tiempo Real**: 2-4x velocidad real (GPU)
|
| 87 |
-
|
| 88 |
-
## π§ Uso del Modelo
|
| 89 |
-
|
| 90 |
-
### InstalaciΓ³n
|
| 91 |
-
|
| 92 |
-
```bash
|
| 93 |
-
pip install torch transformers whisper moviepy librosa opencv-python
|
| 94 |
-
pip install gradio spacy nltk googletrans==4.0.0rc1
|
| 95 |
-
```
|
| 96 |
-
|
| 97 |
-
### Uso BΓ‘sico
|
| 98 |
|
|
|
|
| 99 |
```python
|
| 100 |
from app import ZenVisionModel
|
| 101 |
|
| 102 |
-
#
|
| 103 |
-
|
| 104 |
|
| 105 |
-
#
|
| 106 |
-
video_path, subtitles, status =
|
| 107 |
-
video_file="
|
| 108 |
target_language="es",
|
| 109 |
include_emotions=True
|
| 110 |
)
|
| 111 |
```
|
| 112 |
|
| 113 |
-
###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
|
|
|
| 115 |
```python
|
| 116 |
import gradio as gr
|
| 117 |
from app import ZenVisionModel
|
| 118 |
|
| 119 |
-
# Cargar modelo
|
| 120 |
model = ZenVisionModel()
|
| 121 |
|
| 122 |
-
# Crear interfaz
|
| 123 |
demo = gr.Interface(
|
| 124 |
fn=model.process_video,
|
| 125 |
inputs=[
|
|
@@ -137,77 +121,114 @@ demo = gr.Interface(
|
|
| 137 |
demo.launch()
|
| 138 |
```
|
| 139 |
|
| 140 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
|
| 142 |
-
###
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
- **Italiano**: 94.8%
|
| 148 |
-
- **PortuguΓ©s**: 95.2%
|
| 149 |
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
|
| 155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
|
|
|
|
|
|
|
| 157 |
```
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
β β βββββββββββββββββββ
|
| 171 |
-
β ββββββββββββββββββββ β Emotion Analysisβ
|
| 172 |
-
βββββββββββββββΆβ Emotion Coloring ββββββ (DistilRoBERTa)β
|
| 173 |
-
ββββββββββββββββββββ βββββββββββββββββββ
|
| 174 |
```
|
| 175 |
|
| 176 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
|
| 178 |
-
###
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
- **Fear**: SubtΓtulos morados
|
| 183 |
-
- **Surprise**: SubtΓtulos naranjas
|
| 184 |
-
- **Disgust**: SubtΓtulos verdes
|
| 185 |
-
- **Neutral**: SubtΓtulos blancos
|
| 186 |
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
- **Chroma Features**: CaracterΓsticas tonales
|
| 191 |
-
- **Pause Detection**: SegmentaciΓ³n inteligente
|
| 192 |
|
| 193 |
-
## π
|
| 194 |
|
| 195 |
-
|
| 196 |
|
| 197 |
-
## π₯
|
| 198 |
|
| 199 |
-
|
| 200 |
-
- **
|
| 201 |
-
- **
|
| 202 |
-
- **NLP**:
|
| 203 |
-
- **Computer Vision**:
|
| 204 |
|
| 205 |
-
## π
|
| 206 |
|
| 207 |
-
- **
|
| 208 |
-
- **
|
| 209 |
- **Demo**: [Hugging Face Space](https://huggingface.co/spaces/zenvision/demo)
|
| 210 |
|
| 211 |
---
|
| 212 |
|
| 213 |
-
**ZenVision** -
|
|
|
|
| 51 |
|
| 52 |
# π¬ ZenVision AI Subtitle Generator
|
| 53 |
|
| 54 |
+
**Advanced 3GB+ AI model for automatic video subtitle generation**
|
| 55 |
|
| 56 |
+
ZenVision combines multiple state-of-the-art AI technologies to generate accurate and contextual subtitles for videos with emotion analysis and multi-language support.
|
| 57 |
|
| 58 |
+
## π Model Architecture
|
| 59 |
|
| 60 |
+
### Multi-Modal AI System (3.2GB)
|
| 61 |
+
- **Whisper Large-v2**: Audio transcription
|
| 62 |
+
- **BERT Multilingual**: Text embeddings
|
| 63 |
+
- **RoBERTa Sentiment**: Sentiment analysis
|
| 64 |
+
- **DistilRoBERTa Emotions**: Emotion detection
|
| 65 |
+
- **Helsinki Translation**: Multi-language translation
|
| 66 |
+
- **Advanced NLP**: spaCy + NLTK processing
|
| 67 |
|
| 68 |
+
### Key Features
|
| 69 |
+
- **90+ languages** transcription support
|
| 70 |
+
- **10+ languages** translation
|
| 71 |
+
- **7 emotions** detected with adaptive colors
|
| 72 |
+
- **Real-time processing** 2-4x speed
|
| 73 |
+
- **Multiple formats** SRT, VTT, JSON output
|
| 74 |
+
- **95%+ accuracy** in optimal conditions
|
| 75 |
|
| 76 |
+
## π§ Usage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
+
### Quick Start
|
| 79 |
```python
|
| 80 |
from app import ZenVisionModel
|
| 81 |
|
| 82 |
+
# Initialize model
|
| 83 |
+
model = ZenVisionModel()
|
| 84 |
|
| 85 |
+
# Process video
|
| 86 |
+
video_path, subtitles, status = model.process_video(
|
| 87 |
+
video_file="video.mp4",
|
| 88 |
target_language="es",
|
| 89 |
include_emotions=True
|
| 90 |
)
|
| 91 |
```
|
| 92 |
|
| 93 |
+
### Installation
|
| 94 |
+
```bash
|
| 95 |
+
pip install torch transformers whisper moviepy librosa opencv-python
|
| 96 |
+
pip install gradio spacy nltk googletrans==4.0.0rc1
|
| 97 |
+
python -m spacy download en_core_web_sm
|
| 98 |
+
```
|
| 99 |
|
| 100 |
+
### Gradio Interface
|
| 101 |
```python
|
| 102 |
import gradio as gr
|
| 103 |
from app import ZenVisionModel
|
| 104 |
|
|
|
|
| 105 |
model = ZenVisionModel()
|
| 106 |
|
|
|
|
| 107 |
demo = gr.Interface(
|
| 108 |
fn=model.process_video,
|
| 109 |
inputs=[
|
|
|
|
| 121 |
demo.launch()
|
| 122 |
```
|
| 123 |
|
| 124 |
+
## π Performance
|
| 125 |
+
|
| 126 |
+
### Accuracy by Language
|
| 127 |
+
- **English**: 97.2%
|
| 128 |
+
- **Spanish**: 95.8%
|
| 129 |
+
- **French**: 94.5%
|
| 130 |
+
- **German**: 93.1%
|
| 131 |
+
- **Italian**: 94.8%
|
| 132 |
+
- **Portuguese**: 95.2%
|
| 133 |
+
|
| 134 |
+
### Processing Speed
|
| 135 |
+
- **CPU (Intel i7)**: 0.3x real-time
|
| 136 |
+
- **GPU (RTX 3080)**: 2.1x real-time
|
| 137 |
+
- **GPU (RTX 4090)**: 3.8x real-time
|
| 138 |
+
|
| 139 |
+
## π¨ Emotion-Based Styling
|
| 140 |
+
|
| 141 |
+
- **Joy**: Yellow subtitles
|
| 142 |
+
- **Sadness**: Blue subtitles
|
| 143 |
+
- **Anger**: Red subtitles
|
| 144 |
+
- **Fear**: Purple subtitles
|
| 145 |
+
- **Surprise**: Orange subtitles
|
| 146 |
+
- **Disgust**: Green subtitles
|
| 147 |
+
- **Neutral**: White subtitles
|
| 148 |
+
|
| 149 |
+
## π οΈ Technical Architecture
|
| 150 |
+
|
| 151 |
+
```
|
| 152 |
+
Video Input β Audio Extraction β Whisper Large-v2 β Transcription
|
| 153 |
+
β β β β
|
| 154 |
+
Text Processing β Translation β BERT Embeddings β Emotion Analysis
|
| 155 |
+
β β β β
|
| 156 |
+
Subtitle Output β Emotion Coloring β Smart Formatting β Multi-Format Export
|
| 157 |
+
```
|
| 158 |
+
|
| 159 |
+
## π Output Formats
|
| 160 |
|
| 161 |
+
### SRT Format
|
| 162 |
+
```
|
| 163 |
+
1
|
| 164 |
+
00:00:01,000 --> 00:00:04,000
|
| 165 |
+
Hello, welcome to this tutorial
|
|
|
|
|
|
|
| 166 |
|
| 167 |
+
2
|
| 168 |
+
00:00:04,500 --> 00:00:08,000
|
| 169 |
+
Today we will learn about AI
|
| 170 |
+
```
|
| 171 |
|
| 172 |
+
### VTT Format
|
| 173 |
+
```
|
| 174 |
+
WEBVTT
|
| 175 |
+
|
| 176 |
+
00:00:01.000 --> 00:00:04.000
|
| 177 |
+
Hello, welcome to this tutorial
|
| 178 |
|
| 179 |
+
00:00:04.500 --> 00:00:08.000
|
| 180 |
+
Today we will learn about AI
|
| 181 |
```
|
| 182 |
+
|
| 183 |
+
### JSON with Metadata
|
| 184 |
+
```json
|
| 185 |
+
{
|
| 186 |
+
"start": 1.0,
|
| 187 |
+
"end": 4.0,
|
| 188 |
+
"text": "Hello, welcome to this tutorial",
|
| 189 |
+
"emotion": "joy",
|
| 190 |
+
"sentiment": "positive",
|
| 191 |
+
"confidence": 0.95,
|
| 192 |
+
"entities": [["tutorial", "MISC"]]
|
| 193 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
```
|
| 195 |
|
| 196 |
+
## π§ Configuration
|
| 197 |
+
|
| 198 |
+
### Environment Variables
|
| 199 |
+
```bash
|
| 200 |
+
export ZENVISION_DEVICE="cuda" # cuda, cpu, mps
|
| 201 |
+
export ZENVISION_CACHE_DIR="/path/to/cache"
|
| 202 |
+
export ZENVISION_MAX_DURATION=3600 # seconds
|
| 203 |
+
```
|
| 204 |
|
| 205 |
+
### Model Customization
|
| 206 |
+
```python
|
| 207 |
+
# Change Whisper model
|
| 208 |
+
zenvision.whisper_model = whisper.load_model("medium")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
|
| 210 |
+
# Configure custom translator
|
| 211 |
+
zenvision.translator = pipeline("translation", model="custom-model")
|
| 212 |
+
```
|
|
|
|
|
|
|
| 213 |
|
| 214 |
+
## π License
|
| 215 |
|
| 216 |
+
MIT License - see [LICENSE](LICENSE) for details.
|
| 217 |
|
| 218 |
+
## π₯ ZenVision Team
|
| 219 |
|
| 220 |
+
Developed by specialists in:
|
| 221 |
+
- **AI Architecture**: Language and vision models
|
| 222 |
+
- **Audio Processing**: Digital signal analysis
|
| 223 |
+
- **NLP**: Natural language processing
|
| 224 |
+
- **Computer Vision**: Video and multimedia analysis
|
| 225 |
|
| 226 |
+
## π Links
|
| 227 |
|
| 228 |
+
- **Repository**: [GitHub](https://github.com/zenvision/ai-subtitle-generator)
|
| 229 |
+
- **Documentation**: [docs.zenvision.ai](https://docs.zenvision.ai)
|
| 230 |
- **Demo**: [Hugging Face Space](https://huggingface.co/spaces/zenvision/demo)
|
| 231 |
|
| 232 |
---
|
| 233 |
|
| 234 |
+
**ZenVision** - Revolutionizing audiovisual accessibility with artificial intelligence π
|