New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorflow #296

Merged
merged 10 commits into from Dec 11, 2017

Conversation

Projects
None yet
2 participants
@chriamue
Contributor

chriamue commented Dec 1, 2017

Tensorflow audio commands recognition as shown here: https://www.tensorflow.org/versions/master/tutorials/audio_recognition
Model and Label file can be downloaded here: http://download.tensorflow.org/models/speech_commands_v0.01.zip

An example can be like this:
import speech_recognition as sr
r = sr.Recognizer()
m = sr.Microphone()
def callback(recognizer, audio):
try:
spoken = recognizer.recognize_tensorflow(audio, tensor_graph='speech_recognition/tensorflow-data/conv_actions_frozen.pb', tensor_label='speech_recognition/tensorflow-data/conv_actions_labels.txt')
print(spoken)

with m as source:
r.adjust_for_ambient_noise(source)
stop_listening = r.listen_in_background(m, callback, phrase_time_limit=1)

@Uberi

This comment has been minimized.

Show comment
Hide comment
@Uberi

Uberi Dec 5, 2017

Owner

Hi @chriamue,

Looks good to me! If you're done with this PR, I'd be happy to merge it. I did notice you also have a deepspeech branch, so if you'd rather merge that one, just let me know.

Owner

Uberi commented Dec 5, 2017

Hi @chriamue,

Looks good to me! If you're done with this PR, I'd be happy to merge it. I did notice you also have a deepspeech branch, so if you'd rather merge that one, just let me know.

@chriamue

This comment has been minimized.

Show comment
Hide comment
@chriamue

chriamue Dec 6, 2017

Contributor

I cannot fix following error, because without this import the given graph can not been used.

$ flake8 --ignore=E501,E701 speech_recognition tests examples setup.py
speech_recognition/init.py🔢13: F401 'tensorflow.contrib.framework.python.ops.audio_ops as contrib_audio' imported but unused

Contributor

chriamue commented Dec 6, 2017

I cannot fix following error, because without this import the given graph can not been used.

$ flake8 --ignore=E501,E701 speech_recognition tests examples setup.py
speech_recognition/init.py🔢13: F401 'tensorflow.contrib.framework.python.ops.audio_ops as contrib_audio' imported but unused

@chriamue

This comment has been minimized.

Show comment
Hide comment
@chriamue

chriamue Dec 11, 2017

Contributor

You can merge now. The needed tensorflow import depends on the model. So the user has to import
it himself, like in the tensorflow commands example.

Contributor

chriamue commented Dec 11, 2017

You can merge now. The needed tensorflow import depends on the model. So the user has to import
it himself, like in the tensorflow commands example.

@Uberi

This comment has been minimized.

Show comment
Hide comment
@Uberi

Uberi Dec 11, 2017

Owner

LGTM 👍

Owner

Uberi commented Dec 11, 2017

LGTM 👍

@Uberi Uberi merged commit 19dc36e into Uberi:master Dec 11, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment