We recently launched the Modular Registry, an open-source marketplace to add customized drivers for hardware components or services you might want to include as part of your smart machine. The registry has now been expanded to include machine learning (ML) models.
If you want to use an existing ML model that you've trained outside of Viam or found on the internet, you can upload that model to Viam and you can even share it with the public using the Modular Registry if you want to offer your model for reuse. This means that your models can be shared with anyone else who wants to deploy the same model to their machine. It also removes the need for you to create new models from scratch when you can browse the Registry for perfectly good models that are available to download, deploy, and utilize.
How to find ML models in the Modular Registry
If you've already trained or uploaded ML models prior to this release, you can continue to access them as usual from the Data>Models tab. This includes both private and public models for your organization.
The Modular Registry will show you all models that you have access to–from both your organization as well as the public models from other organizations.
Your organization's private models will be visible to you on the registry page, but will not be publicly available to all users. When you click to view a model in the Modular Registry, it will contain all of the relevant meta.json information like other registry modules do, and will include the model and file type as well. On the Modular Registry, you can see all ML models by looking for their ML model tag.
How to add models into the Modular Registry
There are two different ways to create public machine learning models through the Modular Registry:
- Make a model public while it is uploaded through the Upload Model flow
- Make a pre-existing model public (regardless of whether it was trained before uploading or inside Viam)
I’ll briefly outline the steps for each method below.
To make a model as soon as it is uploaded, go to the Data > Models tab in the Viam application and click on the “Upload model” button. In the “Visibility” section, make sure that the “Public” option is selected. This will ensure that the model is available to everyone when it is published.
To make a pre-existing model public, you can go to the Data > Models tab in the Viam application to view all of the models that are currently available to your organization.
If you click on the three-dot menu on the left-hand side of any existing model, you will have the option to “Make public in Registry.” This allows you to publish the model, and you will be prompted to provide a description that will also be visible alongside it on the Modular Registry.
After publishing the model to the Modular Registry, you will be given the option to “View in Registry,” which will take you to the public model’s page.
Testing an ML model before machine deployment
It is best to make sure a model will work for your environment and use case before deploying it to a smart machine. Viam already has a feature to test a model on stored images that will also now work for any classifier model taken from the Modular Registry.
When selecting an image in your organization, you have the option to select a valid model from your own organization or from the Modular Registry. You will soon have the option to test a model on an entire dataset - stay tuned for that new feature coming in the near future.
Deploying an ML model to a smart machine
Deploying an ML model to a smart machine remains the same in the Viam application even with the addition of models taken from the Modular Registry.
Under “Services,” select an MLmodel > tflite_cpu, and then under “Deploy model on robot” select it on the dropdown list. You then have the option to choose a model from your own organization or from a list of public models.
Coming soon - model monetization in the Modular Registry
Now that machine learning models can be created and shared on the Modular Registry, we are working on a way for developers to turn it into a revenue stream. Stay tuned as we continue developing our plans for an ecosystem that lets ML model creators get paid for the modules they create in the Modular Registry.
Product demo: Using ML models on the Modular Registry
I have recorded a brief video to walk you through the steps described above in the Viam platform and on the Modular Registry.
If you have a smart machine you’d like to augment with machine learning, now is the time to give Viam a spin. Try Viam for free, and then take a look at some of the machine learning algorithms currently available on the Modular Registry, or create your own module to apply any machine learning algorithm you’d like to your machine.
We can’t wait to see how you leverage machine learning to make your machine more efficient!