-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Tensorflow #296
Conversation
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 |
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 |
You can merge now. The needed tensorflow import depends on the model. So the user has to import |
LGTM 👍 |
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)