Skip to content

Deploying to the Raivin

Now that you have validated your Fusion model, this guide will walk you through deploying Fusion models in a Raivin Platform.

Raivin

This guide will showcase two methods of deploying the model.

  1. Live View (Segmentation App)
  2. MCAP Recording

Download the Model

First download the model from EdgeFirst Studio into the Raivin Platform. There are two methods for downloading the model. The first method is to download the model from EdgeFirst Studio and then SCP the model file to the Raivin Platform. The second method is to use the EdgeFirst Client to download the model directly in the device.

Download and SCP

As mentioned under the Trained Models section, the trained models can be downloaded by clicking the "View Additional Details" button on the training session card in EdgeFirst Studio.

Training Session Attributes
Training Session Attributes

This will open the session details and the models are listed under the "Artifacts" tab as shown below. Click on the downward arrow indicated in red to download the models to your PC. In this example, we will be deploying the TFLite model in the Raivin.

Session Details Artifacts
session artifacts

Once the model is downloaded in your PC, you can SCP the model to the Raivin by using this command template.

scp <path to the downloaded TFLite model> <destination path>

An example command is shown below.

scp fusion.tflite torizon@verdin-imx8mp-07130049:~

For more information, please visit Secure Copy.

Download using the Client

This method expects you to have already connected to the Raivin via SSH. The EdgeFirst Client will already come pre installed in the device. You can verify the installation with the client version command.

$ edgefirst-client version
EdgeFirst Studio Server: 3.7.5-def7735 Client: 1.3.4

Next login to the client with the command.

$ edgefirst-client login
Username: user
Password: ****

You will now be able to download the model on the device by the download-artifact command.

edgefirst-client download-artifact <session ID> <model name>

The download-artifact expects three arguments.

  • session ID: Pass the integer trainer or validation session ID associated with the models.
  • model name: Pass the specific model that will be downloaded to the device. Usually this is fusion.tflite.
  • download path (optional): Specify the path to download the model. If not provided, it will download to the current working directory.

Please see EdgeFirst Client For more information on using the client via command line.

Visit the Web UI Service

Visit the Web UI service by entering the URL https://<hostname>/ in your browser.

Note

Replace <hostname> with the hostname of your device.

You should be greeted with the following page.

Web UI
Web UI

For more information, please see the Web UI Walkthrough.

Update the Model Path

Once you are in the Web UI main page, specify the path to the model in the device.

Click the settings icon on the top right corner of the page.

Settings
Settings

Select "Model Settings".

Model Settings
Model Settings

Configure the path to the model in your device as specified under "MODEL:". Once configured, click "Save Configuration" to save your changes.

Model Path
Model Path

Enable and Start the Camera and Model Services

Once the model path in the device is specified, ensure that all services are enabled. To verify, go back to the settings and click on the "Service Status" button.

Service Status
Service Status

You will be greeted with the "Service Overview" page. Ensure that all services are enabled and running by toggling the "Enable" and "Start" buttons as shown. Only "Enable" the "recorder" service as shown. We will be using the recorder service in MCAP Recording.

Service Overview
Service Overview

Live View (Segmentation App)

Now we will demonstrate a live inference of the model in the device. Once all services are enabled, go back to the main page and then select the "Segmentation View" application as shown.

Segmentation App
Segmentation App

This will run inference on the model specified to generate segmentation masks of identified objects on the camera feed and highlights the radar point clouds on the occupancy grid marking the positions of the objects in world coordinates. Examples are shown below.

Sample 1
Sample 1
Sample 2
Sample 2

MCAP Recording

Now we will demonstrate running a recording on the device, saving the model inference, and then visualizing the recording using Foxglove Studio. Once all services are enabled, go back to the main page and then select the "MCAP" application as shown.

MCAP Recorder
MCAP Recorder

You will be greeted with the MCAP recording page.

MCAP Recording Page
MCAP Recording Page

Toggle the "Recording" button as shown to start recording the video feed. To stop the recording, toggle the same button and then the recording will be stored as an MCAP file.

For more information on MCAP recordings, please see the MCAP Recording Service.

Inference Visualization in Foxglove

The MCAP recordings are listed under the list of "MCAP Files" which can then be downloaded to your PC.

MCAP Files
MCAP Files

Once the MCAP recording has been downloaded, we can use Foxglove Studio to see the playback of MCAP recordings and the model inference. The following preview shows the segmentation mask from the model identifying the person in the frame (right) and the occupancy grid highlighting the radar clusters that correspond to the person's position in world coordinates.

Foxglove Sample 1
Foxglove Sample 1

More information on the MCAP playback is provided in Foxglove Studio. Modifying panels and customizing various settings are also shown in Advanced Foxglove.

In this tutorial, you have fetched the trained and validated model from EdgeFirst Studio, copied the model in the Raivin, configured the Raivin model services, and ran inference on the model in the device. You have seen the model running live using the Raivin's camera and Radar module, and ran a Raivin MCAP recording to capture the model inferences in the frame that can be visualized using Foxglove Studio.