Skip to main content
Version: 4.55.1

ML Lens Templates

Lens Studio comes with 5 different templates which demonstrate how you can use SnapML and ML Component.

If you have your own existing model, you can use these templates as a starting point to bring them into Lens Studio.

If you're new to Machine Learning, these templates come with their own sample model so you don’t need to worry about training your own! The template guide also provides you with information about how you can make your own model.

If you'd like to explore training code - please find these and other examples in this public repository

Templates

Style Transfer: Useful as a starting point for style transfer type models which take in a texture and return a modified texture. The template comes with an example style transfer model.
Classification: Useful as a starting point for binary classification type models which output the probability of something.  The template comes with a model that can return the probability of whether someone is wearing glasses or not and call an effect based on this information.
Object Detection: Useful as a starting point for object detection type models which output the location and probability of an object on the camera feed. The template comes with both a car and food detection model, as well as a way to visually call it out.
Custom Segmentation: Useful as a starting point for segmentation type models which take in a texture, and return a segmented version of that texture. The template comes with a pizza segmentation texture and uses Material Editor to make it look sizzling.
Keyword Detection: The Keyword Detection template leverages SnapML to process the result of a MEL Spectrogram analysis of either an audio track or microphone input to enable certain keyword detections.
Image To Image Translation: This template demonstrates how to train and compress popular image-to-image networks like CycleGAN and Pix2Pix so that we could achieve real time performance even on mobile devices. While the model is unique, the project is based off the Style Transfer Template](https://lensstudio.snapchat.com/templates/ml/style-transfer)  
Multi Class Classification with Quantization: This template enables you to create your own Multi Class Classification Machine Learning model, quantize it and use it to trigger different effects in Lens Studio. 
Multi-Object Detection: Demonstrates how to train a multi-object detection model using custom datasets annotated by ourselves with a step-by-step example on berries detection.
Real-Time Neural Rendering: Enables building your AR assets from 2D images taken from your phone. With full compatibility for Snap ML, this model can be run on devices in real time.
Download more templates on Lens Studio Home Screen including Face Mask Classification, Eyebrow Removal, Ground Segmentation, and more!

If you have an ML model, or template that you're interested in sharing, please get in touch.

Was this page helpful?
Yes
No