Installing and Running pre-trained DeepSpeech Model
1 min readDec 8, 2018
Installing DeepSpeech and executing a sample audio file on the Mozilla’s pre-trained deepspeech model in Ubuntu.
- Setup python environment.
- Install virtualenv package.
virtual environment is a tool to create isolated python environments. - Download the DeepSpeech github repository
$ git clone https://github.com/mozilla/DeepSpeech
- Download the pre-trained model
$ wget -O — https://github.com/mozilla/DeepSpeech/releases/download/v0.3.0-models.tar.gz | tar xvfz -
- Create the Virtual Environment
$ virtualenv -p python3 $HOME/tmp/deepspeech-venv/
- Activate the virtual environment
$ source $HOME/tmp/deepspeech-venv/bin/activate
- Install DeepSpeech python binding
$ pip3 install deepspeech
- Within the DeepSpeech directory create an audio file to test
$ arecord my_audio_file.wav
, record the audio and ctrl+c - Install Sox for processing the audio files
$ sudo apt-get install sox
- Within the DeepSpeech directory, calling and executing the deepspeech model
$ deepspeech --model models/output_graph.pbmm --alphabet models/alphabt.txt --lm models/lm.binary --trie models/trie --audio my_audio_file.wav
- The inferred text is displayed.