Lens Studio
With a trained model ready in Roboflow, you can deploy your model to SnapML.
Task Support
| Task Type | Supported by Lens Studio |
|---|---|
| Object Detection | Yes |
| Classification | |
| Instance Segmentation | |
| Semantic Segmentation |
Note: Only models trained using Roboflow Train 3.0 are supported. You can check if a model is trained on Roboflow Train 3.0 by checking the Versions page associated with your model.
Deploy a Model to Lens Studio
Click on "Deploy" in the Roboflow sidebar, then scroll down until you see the "Use with Snap Lens Studio" box. Click "Export to Lens Studio".
When you click this button, a pop up will appear showing information about the classes in your model.
These classes are ordered and will be used in the next step for configuring your model in Lens Studio. Take note of the class list for future use.
In addition, two files will be downloaded:
- The Roboflow Lens Studio template, with which you can use your weights in an application with minimal configuration, and
- Your model weights.
The Roboflow Lens Studio template is 100 MB, so downloading the template may take a few moments depending on your internet connection.
Configure Model in Lens Studio
If you have not already installed Lens Studio, go to the Snap AR website and download the latest version of Lens Studio.
Unzip the Roboflow Lens Studio template you downloaded earlier, then open up the Roboflow-Lens-Template.Isproj file in the unzipped folder.
By default, the template uses a coin counting model. This application draws boxes around each prediction, but you can add your own filters and logic using Lens Studio.
Click the "ML Controller" box at the top of the left sidebar in Lens Studio to open the configuration panel.
To use your own model, click the "ML Model" box and drag the weights downloaded from Roboflow into the pop up box.
When you drag in the weights, you will be prompted with some configuration options. In the "Inputs" section of the pop up, set each "Scale" value to 0.0039. Leave the bias values as they are by default.
Then, click "Import" to import your model.
Configure Classes in Lens Studio
In the "Class Settings" tab below the ML Model button, you will see a list of classes. Set your class names and labels. The labels must be in the order presented in the Roboflow dashboard. You must specify all classes in your model so Snap can interpret the information in the model weights.
Now your application is ready to use. You can use the "Preview" box to use your application on your computer, or demo your application on your own device using the Pairing with Snapchat feature.