Skip to main content

A library for running inference on a DeepSpeech model

Project description

Documentation Task Status

DeepSpeech is an open source Speech-To-Text engine, using a model trained by machine learning techniques based on Baidu’s Deep Speech research paper. Project DeepSpeech uses Google’s TensorFlow to make the implementation easier.

To install and use deepspeech all you have to do is:

# Create and activate a virtualenv
virtualenv -p python3 $HOME/tmp/deepspeech-venv/
source $HOME/tmp/deepspeech-venv/bin/activate

# Install DeepSpeech
pip3 install deepspeech

# Download pre-trained English model and extract
curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.5.1/deepspeech-0.5.1-models.tar.gz
tar xvf deepspeech-0.5.1-models.tar.gz

# Download example audio files
curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.5.1/audio-0.5.1.tar.gz
tar xvf audio-0.5.1.tar.gz

# Transcribe an audio file
deepspeech --model deepspeech-0.5.1-models/output_graph.pbmm --alphabet deepspeech-0.5.1-models/alphabet.txt --lm deepspeech-0.5.1-models/lm.binary --trie deepspeech-0.5.1-models/trie --audio audio/2830-3980-0043.wav

A pre-trained English model is available for use and can be downloaded using the instructions below. Currently, only 16-bit, 16 kHz, mono-channel WAVE audio files are supported in the Python client. A package with some example audio files is available for download in our release notes.

Quicker inference can be performed using a supported NVIDIA GPU on Linux. See the release notes to find which GPUs are supported. To run deepspeech on a GPU, install the GPU specific package:

# Create and activate a virtualenv
virtualenv -p python3 $HOME/tmp/deepspeech-gpu-venv/
source $HOME/tmp/deepspeech-gpu-venv/bin/activate

# Install DeepSpeech CUDA enabled package
pip3 install deepspeech-gpu

# Transcribe an audio file.
deepspeech --model deepspeech-0.5.1-models/output_graph.pbmm --alphabet deepspeech-0.5.1-models/alphabet.txt --lm deepspeech-0.5.1-models/lm.binary --trie deepspeech-0.5.1-models/trie --audio audio/2830-3980-0043.wav

Please ensure you have the required CUDA dependencies.

See the output of deepspeech -h for more information on the use of deepspeech. (If you experience problems running deepspeech, please check required runtime dependencies).


Table of Contents

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

deepspeech_gpu-0.6.0a10-cp37-cp37m-win_amd64.whl (17.3 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

deepspeech_gpu-0.6.0a10-cp37-cp37m-manylinux1_x86_64.whl (18.7 MB view hashes)

Uploaded CPython 3.7m

deepspeech_gpu-0.6.0a10-cp36-cp36m-win_amd64.whl (17.3 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

deepspeech_gpu-0.6.0a10-cp36-cp36m-manylinux1_x86_64.whl (18.7 MB view hashes)

Uploaded CPython 3.6m

deepspeech_gpu-0.6.0a10-cp35-cp35m-win_amd64.whl (17.3 MB view hashes)

Uploaded CPython 3.5m Windows x86-64

deepspeech_gpu-0.6.0a10-cp35-cp35m-manylinux1_x86_64.whl (18.7 MB view hashes)

Uploaded CPython 3.5m

deepspeech_gpu-0.6.0a10-cp34-cp34m-manylinux1_x86_64.whl (18.7 MB view hashes)

Uploaded CPython 3.4m

deepspeech_gpu-0.6.0a10-cp27-cp27mu-manylinux1_x86_64.whl (18.7 MB view hashes)

Uploaded CPython 2.7mu

deepspeech_gpu-0.6.0a10-cp27-cp27m-manylinux1_x86_64.whl (18.7 MB view hashes)

Uploaded CPython 2.7m

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page