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:
Add support for other models
ML models must be designed in particular shapes to work with the mlmodel
classification or detection model of Viam’s vision service.
See ML Model Design to design modular ML model service with models that work with vision.
Note
For some models of the ML model service, like the Triton ML model service for Jetson boards, you can configure the service to use either the available CPU or a dedicated GPU.
Machine learning models from registry
You can search the machine learning models that are available to deploy on this service from the registry here:
API
The ML model service API supports the following methods:
Method Name | Description |
---|---|
Infer | Take an already ordered input tensor as an array, make an inference on the model, and return an output tensor map. |
Metadata | Get the metadata: name, data type, expected tensor/array shape, inputs, and outputs associated with the ML model. |
Reconfigure | Reconfigure this resource. |
DoCommand | Execute model-specific commands that are not otherwise defined by the service API. |
GetResourceName | Get the ResourceName for this instance of the ML model service with the given name. |
Close | Safely 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:
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!