DeepSpeech/native_client
2017-06-30 08:48:25 +02:00
..
c_speech_features Remove need for -std=gnu99 in c_speech_features 2017-05-17 11:44:45 +01:00
javascript Use libtensorflow_cc for C++ API 2017-06-28 20:57:12 +02:00
kiss_fft130 Implement a native client using TensorFlow C API 2017-02-23 16:35:44 +00:00
python Split audioToInputVector into a separate library 2017-06-27 10:16:54 +01:00
BUILD Split audioToInputVector into a separate library 2017-06-27 10:16:54 +01:00
client.cc Various renames in libdeepspeech to allow for clearer more efficient use 2017-05-17 10:52:14 +01:00
client.js Add Node.js bindings 2017-06-27 10:38:41 +01:00
client.py Split audioToInputVector into a separate library 2017-06-27 10:16:54 +01:00
deepspeech_utils.cc Split audioToInputVector into a separate library 2017-06-27 10:16:54 +01:00
deepspeech_utils.h Split audioToInputVector into a separate library 2017-06-27 10:16:54 +01:00
deepspeech.cc Split audioToInputVector into a separate library 2017-06-27 10:16:54 +01:00
deepspeech.h Split audioToInputVector into a separate library 2017-06-27 10:16:54 +01:00
Makefile Use libtensorflow_cc for C++ API 2017-06-28 20:57:12 +02:00
multistrap.conf Building DeepSpeech on TaskCluster 2017-04-10 18:35:08 +02:00
package.json Add Node.js bindings 2017-06-27 10:38:41 +01:00
README.md Use libtensorflow_cc for C++ API 2017-06-28 20:57:12 +02:00
setup.cfg Use deepspeech Python library in util/audio.py 2017-06-27 10:16:54 +01:00
setup.py Change library link ordering for python binding 2017-06-30 08:48:25 +02:00

DeepSpeech native client

A native client for running queries on an exported DeepSpeech model.

Requirements

Preparation

Create a symbolic link in the TensorFlow checkout to the deepspeech native_client directory.

cd tensorflow
ln -s ../DeepSpeech/native_client ./

Building

Before building the DeepSpeech client libraries, you will need to prepare your environment to configure and build TensorFlow. Follow the instructions on the TensorFlow site for your platform, up to the end of 'Configure the installation'.

Then you can build the Tensorflow and DeepSpeech libraries.

bazel build -c opt --copt=-march=native --copt=-mtune=native --copt=-O3 //tensorflow:libtensorflow_cc.so //native_client:*

Finally, you can change to the native_client directory and use the Makefile. By default, the Makefile will assume there is a TensorFlow checkout in a directory above the DeepSpeech checkout. If that is not the case, set the environment variable TFDIR to point to the right directory.

cd ../DeepSpeech/native_client
make deepspeech

Installing

After building, the library files and binary can optionally be installed to a system path for ease of development. This is also a required step for bindings generation.

PREFIX=/usr/local sudo make install

It is assumed that $PREFIX/lib is a valid library path, otherwise you may need to alter your environment.

Running

The client can be run via the Makefile. The client will accept audio of any format your installation of SoX supports.

ARGS="/path/to/output_graph.pb /path/to/audio/file.ogg" make run

Python bindings

Included are a set of generated Python bindings. After following the above build and installation instructions, these can be installed by executing the following commands (or equivalent on your system):

make bindings
sudo pip install dist/deepspeech*

The API mirrors the C++ API and is demonstrated in client.py. Refer to deepspeech.h for documentation.