Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
title: Accent Detector
|
3 |
emoji: π’
|
|
|
1 |
+
|
2 |
+
# π£οΈ Accent Identifier
|
3 |
+
|
4 |
+
This tool identifies the **speaker's accent** from a video or audio input. It supports uploads and URLs β including **direct `.mp4` links**, **Loom videos**, and **YouTube-style links** β and uses a deep learning model from [SpeechBrain](https://speechbrain.readthedocs.io/en/latest/index.html) for inference.
|
5 |
+
|
6 |
+
## π Demo
|
7 |
+
|
8 |
+
Try it out live on [Hugging Face Spaces](https://pheire-accent-detector.hf.space) *(replace with your actual link)*.
|
9 |
+
|
10 |
+
---
|
11 |
+
|
12 |
+
## π¦ Features
|
13 |
+
|
14 |
+
* π₯ Accepts video/audio uploads (`.mp4`, `.wav`, `.mp3`)
|
15 |
+
* π Handles direct URLs (e.g. Loom, direct `.mp4`, YouTube)
|
16 |
+
* π§ Classifies accent using `speechbrain` pretrained model
|
17 |
+
* π Returns top prediction and top-3 probabilities
|
18 |
+
* β‘ Fast and easy UI built with [Gradio](https://gradio.app)
|
19 |
+
|
20 |
+
---
|
21 |
+
|
22 |
+
## π§ͺ Example Inputs
|
23 |
+
|
24 |
+
* `https://www.loom.com/share/abc123`
|
25 |
+
* `https://yourdomain.com/sample.mp4`
|
26 |
+
* Uploaded audio: `voice_sample.wav`
|
27 |
+
|
28 |
+
---
|
29 |
+
|
30 |
+
## π οΈ Installation
|
31 |
+
|
32 |
+
```bash
|
33 |
+
git clone https://github.com/yourusername/accent-identifier.git
|
34 |
+
cd accent-identifier
|
35 |
+
|
36 |
+
# Create virtual environment (optional but recommended)
|
37 |
+
python -m venv venv
|
38 |
+
source venv/bin/activate # On Windows use `venv\Scripts\activate`
|
39 |
+
|
40 |
+
# Install dependencies
|
41 |
+
pip install -r requirements.txt
|
42 |
+
```
|
43 |
+
|
44 |
+
### requirements.txt
|
45 |
+
|
46 |
+
```
|
47 |
+
speechbrain
|
48 |
+
gradio
|
49 |
+
torchaudio
|
50 |
+
torch
|
51 |
+
ffmpeg-python
|
52 |
+
yt-dlp
|
53 |
+
requests
|
54 |
+
```
|
55 |
+
|
56 |
+
Make sure `ffmpeg` is installed and available in your system path.
|
57 |
+
You can test with: `ffmpeg -version`
|
58 |
+
|
59 |
+
---
|
60 |
+
|
61 |
+
## βΆοΈ Run Locally
|
62 |
+
|
63 |
+
```bash
|
64 |
+
python app.py
|
65 |
+
```
|
66 |
+
|
67 |
+
This will launch a Gradio interface in your browser at `http://localhost:7860`.
|
68 |
+
|
69 |
+
---
|
70 |
+
|
71 |
+
## π§ Model Details
|
72 |
+
|
73 |
+
* **Model**: `Jzuluaga/accent-id-commonaccent_ecapa`
|
74 |
+
* **Framework**: [SpeechBrain](https://speechbrain.readthedocs.io/)
|
75 |
+
* **Classes**: US, UK, Australia, Canada, India, etc.
|
76 |
+
|
77 |
+
---
|
78 |
+
|
79 |
+
## π Project Structure
|
80 |
+
|
81 |
+
```
|
82 |
+
accent-identifier/
|
83 |
+
βββ app.py # Main Gradio app
|
84 |
+
βββ requirements.txt # Dependencies
|
85 |
+
βββ README.md # You are here
|
86 |
+
```
|
87 |
+
|
88 |
+
---
|
89 |
+
|
90 |
+
## π§© Notes
|
91 |
+
|
92 |
+
* Loom support relies on their internal API. It may break if they change the endpoint.
|
93 |
+
* Audio is extracted to `.wav` using `ffmpeg` with 16kHz mono format for model compatibility.
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
---
|
99 |
title: Accent Detector
|
100 |
emoji: π’
|