Skip to content

A wrapper for Audeering's wav2vec-based dimensional speech emotion recognition

Notifications You must be signed in to change notification settings

bagustris/w2v2-vad

Repository files navigation

w2v2-vad

A wrapper for Audeering's wav2vector-based dimensional speech emotion recognition (arousal, dominance, and valence).

Input-output

input: any audio file readable by torchaudio at any sample rate (will be resampled to 16000 Hz on the fly)
output: score of valence, arousal, and dominance in a range [0, 1]

Virtual Environment

I recommend using a virtual environment to run this script. You can use either venv or conda. I prefer to use (Mini) conda now over venv. Here is the example.

conda create -n w2v2-vad python=3.8
conda activate w2v2-vad

Installation

pip3 install -r requirements.txt

Usage

python3 predict_vad_w2v2.py input.wav

Arguments

Positional: input file at any sample rate
Optional:  
-s split, `chunks` or `full`, default is full.  
-d duration, duration in seconds (if the split is chunks, must be specified)  

Example

bagus@L140MU:w2v2-vad$ python3 predict_vad_w2v2.py bagus-test_16000.wav 
Arousal, dominance, and valence #0: [[0.32293236 0.41639617 0.5942142 ]]
bagus@L140MU:w2v2-vad$ python3 predict_vad_w2v2.py bagus-test_16000.wav -s chunks -d 2
Arousal, dominance, and valence #0: [[0.3404813  0.42247295 0.35256445]]
Arousal, dominance, and valence #1: [[0.22009875 0.322832   0.51018834]]
Arousal, dominance, and valence #2: [[0.3478799  0.4332775  0.45645887]]
Arousal, dominance, and valence #3: [[0.29967275 0.4038131  0.4949872 ]]
Arousal, dominance, and valence #4: [[0.24804251 0.33543587 0.50990975]]
Arousal, dominance, and valence #5: [[0.38564402 0.43214017 0.37035757]]

Demo (v1.0)

asciicast

Original repo

https://github.com/audeering/w2v2-how-to

All credit goes to Audeering.

About

A wrapper for Audeering's wav2vec-based dimensional speech emotion recognition

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages