Downloads · 30 days
8
21% of all-time downloads
kojima-r/wav2vec2-bird-jp-all
wav2vec2-bird-jp-all is a machine learning model from kojima-r. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This is a wav2vec2-base model trained from a dataset of japanese bird songs.
Downloads · 30 days
8
21% of all-time downloads
All-time downloads
39
Public
Repo size
380 MB
Likes
0
Public
Click a slice to open those files.
.bin380 MB · 100%
From the Hugging Face model README
This is a wav2vec2-base model trained from a dataset of japanese bird songs.
import librosa
import torch
from transformers import Wav2Vec2ForPreTraining,Wav2Vec2Processor
sound_file = 'sample.wav'
sound_data,_ = librosa.load(sound_file, sr=16000)
model_id = "kojima-r/wav2vec2-bird-jp-all"
model = Wav2Vec2ForPreTraining.from_pretrained(model_id)
result=model(torch.tensor([sound_data]))
hidden_vecs=result.projected_states
print(hidden_vecs.shape)
For example, the output of this program is like
torch.Size([1, 444, 256])
where the hidden_vecs represent a tensor with (#samples) x (#Time-steps) x (dim. of hidden vector). Note that #samples is always one in this case.