You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/04.pro/shields/portenta-vision-shield/tutorials/user-manual/content.md
+49-27Lines changed: 49 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -690,49 +690,71 @@ With this script running you will be able to see the Fast Fourier Transform resu
690
690
691
691
You can easily implement sound/voice recognition applications using Machine Learning on the edge, this means that the Portenta H7 plus the Vision Shield can run these algorithms locally.
692
692
693
-
For this example, we are going to test a [pre-trained model]((https://raw.githubusercontent.com/iabdalkader/microspeech-yesno-model/main/model.tflite)) that can recognize the `yes` and `no` keywords
693
+
Use the following script to run the example. It can also be found on **File > Examples > Audio > micro_speech.py** in the OpenMV IDE.
# Starts the audio streaming and processes incoming audio to recognize speech commands.
711
+
# If a callback is passed, listen() will loop forever and call the callback when a keyword
712
+
# is detected. Alternatively, `listen()` can be called with a timeout (in ms), and it
713
+
# returns if the timeout expires before detecting a keyword.
714
+
speech.listen(callback=callback, threshold=0.70)
715
+
```
716
+
717
+
In the example from above you can notice that there is no model defined explicitly, this is because it will use the default built-in model pre-trained to recognize the **yes** and **no** keywords.
718
+
719
+
You can run the script and say the keywords, if any is recognized, the *Serial Terminal* will print the heard word and the inference scores.
720
+
721
+
#### Custom Speech Recognition Model
722
+
723
+
You can easily run custom speech recognition models also. To show you how, we are going to replicate the **yes** and **no** example but this time using the `.tflite` model file.
694
724
695
725
First, download the `.tflite`[model](https://raw.githubusercontent.com/iabdalkader/microspeech-yesno-model/main/model.tflite) and copy it to the H7 local storage.
696
726
697
-
Use the following script to run the example. It can also be found on **File > Examples > Audio > micro_speech.py** in the OpenMV IDE.
727
+

728
+
729
+
Copy and paste the following script based in the original example:
***If you want to create a custom model `.tflite` file, you can do it with your own keywords or sounds using [Edge Impulse](https://docs.edgeimpulse.com/docs/edge-ai-hardware/mcu/arduino-portenta-h7).***
757
+
736
758
## Machine Learning Tool
737
759
738
760
The main features of the Portenta Vision Shield are the audio and video capabilities. This makes it a perfect option for almost infinite machine-learning applications.
0 commit comments