Views
No views yet
| Multi-Task Setup | |||||
|---|---|---|---|---|---|
| Test 3 | Development | ||||
| Val | Dom | Aro | Val | Dom | Aro |
| 0.577 | 0.577 | 0.405 | 0.652 | 0.688 | 0.579 |
@InProceedings{Goncalves_2024,
author={L. Goncalves and A. N. Salman and A. {Reddy Naini} and L. Moro-Velazquez and T. Thebaud and L. {Paola Garcia} and N. Dehak and B. Sisman and C. Busso},
title={Odyssey2024 - Speech Emotion Recognition Challenge: Dataset, Baseline Framework, and Results},
booktitle={Odyssey 2024: The Speaker and Language Recognition Workshop)},
volume={To appear},
year={2024},
month={June},
address = {Quebec, Canada},
}1from transformers import AutoModelForAudioClassification
2import librosa, torch
3
4#load model
5model = AutoModelForAudioClassification.from_pretrained("3loi/SER-Odyssey-Baseline-WavLM-Multi-Attributes", trust_remote_code=True)
6
7#get mean/std
8mean = model.config.mean
9std = model.config.std
10
11
12#load an audio file
13audio_path = "/path/to/audio.wav"
14raw_wav, _ = librosa.load(audio_path, sr=model.config.sampling_rate)
15
16#normalize the audio by mean/std
17norm_wav = (raw_wav - mean) / (std+0.000001)
18
19#generate the mask
20mask = torch.ones(1, len(norm_wav))
21
22#batch it (add dim)
23wavs = torch.tensor(norm_wav).unsqueeze(0)
24
25
26#predict
27with torch.no_grad():
28 pred = model(wavs, mask)
29
30print(model.config.id2label)
31print(pred)
32#{0: 'arousal', 1: 'dominance', 2: 'valence'}
33#tensor([[0.3670, 0.4553, 0.4240]])