File size: 1,122 Bytes
f161851
d06a3b3
ba84c3f
f161851
 
593cca4
 
f161851
 
ba84c3f
f161851
 
d06a3b3
ba84c3f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: Wav2Lip CPU
emoji: 👄
sdk: gradio
sdk_version: 6.3.0
colorFrom: red
colorTo: pink
app_file: app.py
pinned: false
license: mit
---

# Wav2Lip - CPU Lip Sync

> **Based on [saifhassan/Wav2Lip-HD](https://github.com/saifhassan/Wav2Lip-HD)**
>
> CPU-only conversion for HuggingFace Spaces free tier (no GPU required).

## Features

- **ONNX Wav2Lip model** (145MB) - runs on CPU
- **OpenCV face detection** - no GPU needed
- **Mouth-paste approach** - preserves original face quality
- **Temporal smoothing** - reduces face bbox flickering

## How It Works

1. Detect face using OpenCV Haar Cascade
2. Crop and resize to 96x96
3. Run Wav2Lip ONNX inference
4. Extract mouth region from output
5. Scale and paste onto original face
6. Feather blend at seam

## Limitations

- Max 500 frames (~20 seconds at 25fps)
- ~1-2 sec/frame on CPU
- Best with frontal faces

## Credits

- [Wav2Lip](https://github.com/Rudrabha/Wav2Lip) - Original model
- [Wav2Lip-HD](https://github.com/saifhassan/Wav2Lip-HD) - HD approach
- [bluefoxcreation/Wav2lip-Onnx](https://huggingface.co/bluefoxcreation/Wav2lip-Onnx) - ONNX models