Other Parts Discussed in Thread: TDA4VM
Hello,
Edge Impulse is a tool for creating, analyzing, and deploying machine learning to embedded targets. TI Processors, like the AM62x and TDA4VM, running the default Processor SDK for Linux can quickly and easily be used directly with Edge Impulse's tools, allowing developers to use their embedded processor to collect data and test their model.
This page will describe how to set up Edge Impulse's Linux command line tools on one of our processor Starter Kits running Linux so it can be connected to Edge Impulse cloud tools.
What you will need:
- Processor Starter Kit: SK-AM62 or SK-TDA4VM
- Camera -- a USB webcam is the simplest
- Network connection to access Edge Impulse cloud
- Items required by the starter kit's guide, e.g. serial cable, power supply
1. Set up device according to Starter Kit Quick-Start Guide
Follow the instructions for the corresponding device
Once Linux is installed and you have a successful network connection, you can move on. Note that Edge Impulse tools may not be able to connect fully through a proxy.
2. Install Edge Impulse tools in Linux
The base instructions are available on Edge Impulse's docs page, but only instructions 3 must be run since npm is already installed and only the root user exists. Run the following command in the terminal
npm install -g --unsafe-perm edge-impulse-linux
If the network connection is behind a proxy, then that can be provided like so:
npm install -g --unsafe-perm edge-impulse-linux -p PROXY_URL:PROXY_PORT
Note: if the starter kit device does not automatically synchronize its clock, NPM may not allow it to installed. The simplest fix is to update the date with the following command:
- date --set="YYYYMMDD HH:MM:SS" where the actual string is your current time and date.
3. Set up an Edge Impulse account and create/clone a project
Create an account at https://studio.edgeimpulse.com/login. This is necessary to connect one of our starter kits to Edge Impulse's cloud for data collection and machine learning inference.
Next, create or clone a project. You can create a project yourself to start from scratch. To evaluate our device faster, we recommend cloning the public Visual Wakewords project, which will detect if a person is in the frame or not.
4. Collect data through Edge Impulse
Next, we'll show how to collect data directly into Edge Impulse's cloud tool. We will connect the device to their service and a specific project.
On a starter kit with an active Internet connection, run the following command:
-
edge-impulse-linux
Log in with your username and password -- this will fail if there is no network connection
Select a project and give your device a name
- If the device doesn't have a camera and mic attached, the tool will exit early. Command line options can be used to avoid this (printout will provide these)
Your device will show up under the project you selected – go to the Data Acquisition tab, and the rightmost pane will let you collect live data through this device!
The command line will look like the following by the end of this process:
Here is an example of what the Edge Impulse tool will look like. Be sure to select the appropriate type of sensor for your device.
If you want to select a different project, rename the device, change the sensor or login with a different account, use the --clean command line option when running edge-impulse-linux
If you're using a CSI camera, please see additional instructions from the AM62x Linux academy.
5. Explore Edge Impulse's tools
See more of what they have! If this is a new project, experiment with creating new processing blocks ("Impulses"), model training, model tuning, different models, etc.
Once you have a model you're ready to test on the device, feel free to move on.
6. Run Inference on your Starter Kit
To test models and evaluate performance on device, Edge Impulse provides a command line tool that will download the model, compile it into a program, and then run it on live input to show how it performs on your target device. The steps are very similar to before, but all of the machine learning magic will now be on your device
Run the follow command:
-
edge-impulse-linux-runner
Similar to before, login, select a project, select an input source (if there are multiple options), and let it run.
If it is the first time this model has been used on this device, it will take a moment to compile the program. Before it begins running inference on new input, it will quickly print out that there is a local network server where you can see this happening live. Generally, this is the IP address of the device at port 4912. Below is an example of this printout in the command line.
The exact execution time per inference and set of classes to recognize will depend on the model used in your project.
If you'd like to change a configuration when rerunning the command, add the --clean tag, just as before.
7. Moving Forward with an Edge Impulse design
If you've made it this far, congratulations! You have one of our processors connected in with Edge Impulse's tools, which are great for designing, debugging, and deploying high quality machine learning models to embedded targets.
We're expecting to have a tighter integration with Edge Impulse soon, but until then, all of the standard Linux tools and outputs from EI will work in Linux for the AM62x and TDA4VM. The Linux deployment option (shown below) produces an EIM model, which is meant to work alongside the EI SDK. For now, the C++ and Node.JS SDKs will work. Additionally, the Dashboard has an option for downloading Tensorflow Lite models, which will run on our device without issue since that runtime is included in the Processor SDK for Linux by default
Or download the model(s) from the Blocks output. Note that devices with a deep learning accelerator will work best on int8 models.
Let us know more about how you're using TI Processors and/or Edge Impulse for your Edge AI Applications! If you have issues, please don't hesitate to reach out to use on e2e.ti.com. Thanks!