Get Informed out of Data

Full width home advertisement

Raspbian

DataScience

Post Page Advertisement [Top]

Deep Speech on Raspberry pi 4

Deep Speech on Raspberry pi 4

DeepSpeech or Mozilla Voice STT (Speech To Text) is an open-source Speech-to-Text engine that is trained using machine learning techniques. It is designed as a counterweight to closed source services operated by Google, Amazon, and other companies.


DeepSpeech uses machine learning techniques that are based on Baidu's Deep Speech research paper and Google TensorFlow for its implementation. The service can be run on a wide range of devices in real-time including Raspberry Pi 4, devices that run Windows, OS X or Linux, Android, and iOS.

Install DeepSpeech 0.8.2

sudo apt install git python3-pip python3-scipy python3-numpy python3-pyaudio libatlas3-base
pip3 install deepspeech --upgrade
mkdir ~/dspeech
cd ~/dspeech
curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.8.2/deepspeech-0.8.2-models.tflite
curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.8.2/deepspeech-0.8.2-models.scorer
curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.8.2/audio-0.8.2.tar.gz
tar xvf audio-0.8.2.tar.gz
source ~/.profile

Transcribe three test files.

deepspeech --model deepspeech-0.8.2-models.tflite --scorer deepspeech-0.8.2-models.scorer --audio audio/2830-3980-0043.wav
deepspeech --model deepspeech-0.8.2-models.tflite --scorer deepspeech-0.8.2-models.scorer --audio audio/4507-16021-0012.wav
deepspeech --model deepspeech-0.8.2-models.tflite --scorer deepspeech-0.8.2-models.scorer --audio audio/8455-210777-0068.wav

Live transcription from a microphone

To try live transcription from a microphone, plug in a USB microphone.

Change alsa.conf file so the microphone (device 2) is the default ALSA device. The latest version of Raspbian as of June 2020 has two soundcards. One for the built-in HDMI audio and one for the built-in headphone jack.

sudo nano /usr/share/alsa/alsa.conf
defaults.ctl.card 2
defaults.pcm.card 2

Install DeepSpeech examples including the microphone example and dependencies.

git clone https://github.com/mozilla/DeepSpeech-examples
pip3 install halo webrtcvad --upgrade
python3 DeepSpeech-examples/mic_vad_streaming/mic_vad_streaming.py --device 1 -m deepspeech-0.8.2-models.tflite -s deepspeech-0.8.2-models.scorer

No comments:

Post a Comment

Bottom Ad [Post Page]