Training Loop with Edge Impulse
Create a loop with the Edge Impulse training platform and the AI Manager.
General Preparation
This tutorial assumes you have the following things already set up:
Nx Cloud account.
Nx Meta system installed.
System connected to Nx Cloud account.
Client installed.
Device added to configuration.
AI plugin installed.
Install the sclbl-integration-sdk repository.
git clone https://github.com/scailable/sclbl-integration-sdk.gitFollowed the ‘Get started’ instructions.
Edge Impulse Preparation
When building a loop with Edge Impulse, you need a project with a trained model, plus its API key and project ID. See Step 1: Coupling Your Edge Impulse Model With Nx for where to find both.
The project ID is also shown in a box on the project info page:

Steps
This loop consists of 7 steps.
Add model to the AI Manager Cloud
Update postprocessor
Configure model and postprocessor
Run the model
Check the data
Update the model in the cloud
Update model in the system
Step 1: Add Model to AI Manager Cloud
Add the model of the training platform to the AI Manager Cloud.
For Edge Impulse
Start by creating a new project on the Edge Impulse platform:

Upload and annotate your training examples, then train an object detection model. A getting started guide is available at https://docs.edgeimpulse.com/docs/tutorials/detect-objects-using-fomo.
Work through the data acquisition and impulse creation steps to reach the model selection screen:

Select FOMO MobileNetV2 (0.1 or 0.35) or YOLOv5. Click "Start training" and wait for training to finish.
Once training finishes, link the trained model to the AI Manager Cloud. See Step 1: Coupling Your Edge Impulse Model With Nx for the full walkthrough with screenshots.
Step 2: Update Postprocessor
This step takes an example postprocessor from the sclbl-integration-sdk and modifies it with a specific condition to filter only certain images for sending.
For Edge Impulse
Open the sclbl-integration-sdk into your favourite editor.
Open the following Python script: postprocessor-python-edgeimpulse-example/postprocessor-python-edgeimpulse-example.py
Find the location where the API is set and replace it with the API-key from your project. Look for the line:
edgeimpulse.API_KEYFind the line
upload_sample = Falseand modify the code below that to suit your condition.Compile and install the postprocessor using the instructions in the README.md of the project.
Step 3: Configure Model and Postprocessor
Select the model and postprocessor.
In the desktop client go to the device, right click and select ‘Camera settings’.
Go to the tab ‘Plugins’ and select the ‘AI Manager’.
Click Manage Server, then click the icon with left-right arrows called Switch, or Assign a New Model if no model is assigned yet.
Choose the model from step 1 and click ‘Ok’.
Under the heading ‘Assigned Models’, select ‘Post Processor’ and select your post processor from step 2. If you didn’t rename it from the README it is called ‘Example-Postprocessor’.
Under the heading ‘Runtime Status’, click ‘Start’ and wait for the status to be ‘Runtime is running’.
Click ‘Ok’ at the bottom.
Step 4: Run the Model
To run the model the device must be visible in the layout.
Double click your device to make it visible.
On the top right click the left icon ‘Object search’ if the model contains bounding boxes to see them.
Step 5: Check the Data
This step checks the incoming data, labels it, and retrains the model.
Edge Impulse
See also the section on importing models from Edge Impulse.
Go to the project page.
Select ‘Data acquisition’.
Training and Test should contain data coming from the server.
Label the data.
Select ‘Retrain model’ and then ‘Train model’.
Step 6: Update the Model in the Cloud
This step updates the model in the AI Manager Cloud.
Two ways to update the model
Go back to the ‘Manage server’ in the desktop client / AI plugin and click the name of the model.
Log into the AI Manager Cloud and go to the model.
Click the button ‘Update from <TrainingPlatform>’
Step 7: Update Model in the System (Work in Progress)
This step updates the models in the system.
(option not available yet) In the desktop client / AI plugin click the button ‘Update models’.
Manually delete the model cache. Follow these instructions:
On the commandline:
In the desktop client / AI plugin stop and start the plugin
Last updated