Installing and Running pre-trained DeepSpeech Model

Kiran devraj
1 min readDec 8, 2018

--

Installing DeepSpeech and executing a sample audio file on the Mozilla’s pre-trained deepspeech model in Ubuntu.

  1. Setup python environment.
  2. Install virtualenv package.
    virtual environment is a tool to create isolated python environments.
  3. Download the DeepSpeech github repository
    $ git clone https://github.com/mozilla/DeepSpeech
  4. Download the pre-trained model
    $ wget -O — https://github.com/mozilla/DeepSpeech/releases/download/v0.3.0-models.tar.gz | tar xvfz -
  5. Create the Virtual Environment
    $ virtualenv -p python3 $HOME/tmp/deepspeech-venv/
  6. Activate the virtual environment
    $ source $HOME/tmp/deepspeech-venv/bin/activate
  7. Install DeepSpeech python binding
    $ pip3 install deepspeech
  8. Within the DeepSpeech directory create an audio file to test
    $ arecord my_audio_file.wav , record the audio and ctrl+c
  9. Install Sox for processing the audio files
    $ sudo apt-get install sox
  10. 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
  11. The inferred text is displayed.

--

--