Barracuda API

Barracuda-API-1
ExampleBarracudaAPI

Purpose

This example demonstrates how to examine and run unit tests on various Machine Learning models residing within/outside RIDE backed with Unity Barracuda framework

How to Use

Run-time, either inside Unity editor or standalone:

  1. Select the Inference Type from the dropdown list. For this example here choose Classification.
  2. Load the Machine Learning model (as ONNX) into the scene by pressing the Load ONNX Model button. This model can lie within the Unity project or anywhere locally. For this example, in the file manager that pops up, browse to Assets/Ride/ML/BarracudaAPI/Models/Classification and select the classification_efficientnet-lite4-11.onnx file there and click Open.

  3. Load the parameters defining the sizes of various I/O for this model. Click on the Load Parameters button. This file can lie within the Unity project or anywhere locally. For this example, in the file manager that pops up, browse to Assets/Ride/ML/BarracudaAPI/Models/Classification and select the parameters.txt file there and click Open.
  4. Load the labels defining the various classes for the classification. Click on the Load Labels button. This file can lie within the Unity project or anywhere locally. For this example, in the file manager that pops up, browse to Assets/Ride/ML/BarracudaAPI/Models/Classification and select the labels_map.txt file there and click Open.
  5. Select the Input Type from the drop down list. Choose Single Image.
  6. Load in the image input by pressing the Load Input button. This image can lie within the Unity project or anywhere locally. For this example, in the file manager that pops up, browse to Assets/Ride/ML/BarracudaAPI/Models/Classification/Test data and select the water_bottle.png file there and click Open.
  7. Click on the Run Inference button to the result of this Classification model.


Other Use Cases

Classification from live webcam feed:

RIDE MSELI:

 

Scene Location & Name

Assets/Ride/ML/BarracudaAPI/Scenes/ExampleBarracudaAPI.unity

Setup Requirements 

For the Ride MSELI example, make sure to unzip Assets/Ride/ML/BarracudaAPI/Models/MSELI_LSTM/Test data.zip before running the experience.

Note

Currently this API does not work in WebGL mode. Investigating compatibility in a future update.