ML Model Service

Machine learning (ML) provides your machines with the ability to adjust their behavior based on models that recognize patterns or make predictions.

Common use cases include:

  • Object detection, which enables machines to detect people, animals, plants, or other objects with bounding boxes, and to perform actions when they are detected.
  • Object classification, which enables machines to separate people, animals, plants, or other objects into predefined categories based on their characteristics, and to perform different actions based on the classes of objects.
  • Speech recognition, natural language processing, and speech synthesis, which enable machines to verbally communicate with us.

The Machine Learning (ML) model service allows you to deploy machine learning models to your machine. The service works with models trained inside and outside the Viam app:

  • You can train models on data from your machines.
  • You can upload externally trained models on the MODELS tab in the DATA section of the Viam app.
  • You can use ML models from the Viam Registry.
  • You can use a model trained outside the Viam platform whose files are on your machine.

Configuration

You must deploy an ML model service to use machine learning models on your machines. Once you have deployed the ML model service, you can select an ML model.

After deploying your model, you need to configure an additional service to use the deployed model. For example, you can configure an mlmodel vision service to visualize the predictions your model makes. For other use cases, consider creating custom functionality with a module.

For configuration information, click on the model name:

Model
Description

Machine learning models from registry

You can search the machine learning models that are available to deploy on this service from the registry here:

Model
Type
Framework
Description

API

The ML model service API supports the following methods:

Method NameDescription
InferTake an already ordered input tensor as an array, make an inference on the model, and return an output tensor map.
MetadataGet the metadata: name, data type, expected tensor/array shape, inputs, and outputs associated with the ML model.
ReconfigureReconfigure this resource.
DoCommandExecute model-specific commands that are not otherwise defined by the service API.
GetResourceNameGet the ResourceName for this instance of the ML model service with the given name.
CloseSafely shut down the resource and prevent further use.

Next steps

The ML model service only runs your model on the machine. To use the inferences from the model, you must use an additional service such as a vision service: