tflite-speech-recognition icon indicating copy to clipboard operation
tflite-speech-recognition copied to clipboard

Help with Using the model on Computer

Open nishant2019 opened this issue 5 years ago • 3 comments
trafficstars

Firstly I want to compliment on excellent tutorial.

How can I use PC itself instead of raspberry pi to use the "h5" model to detect stop word in real time I am looking to convert "04-rpi-tflite-audio-stream.py" for computer version

nishant2019 avatar Aug 12 '20 07:08 nishant2019

Glad you found it helpful!

The .h5 model is a Keras model, so once you load it into your program, you can use model.predict() (https://www.tensorflow.org/api_docs/python/tf/keras/Model#predict) to make predictions. From my experience, it's a bit slow, but it's the only way I know how to do it at the moment. I'm sure there's a way to get TensorFlow to make predictions more quickly without using Keras.

ShawnHymel avatar Aug 12 '20 14:08 ShawnHymel

Thanks for reply. Actually I wanted to do live speech recognition of PC and not on Pi. But your code for Pi is not running correctly on PC even after modification and using model.predict(). Can you please modify the code for PC

nishant2019 avatar Aug 12 '20 17:08 nishant2019

I'll keep it in mind as a to-do, but I don't know if I'll have time for it right now. Please note that I'm working on a newer/better version of this speech recognition tool here: https://github.com/ShawnHymel/custom_wake_word

ShawnHymel avatar Aug 12 '20 21:08 ShawnHymel