Export from TensorFlow
- Snapchat: fully supported
- SPECS: partially supported
- Camera Kit Web: fully supported
- Camera Kit Mobile: fully supported
- SnapchatFully supported
- SPECSPartially supported
- Models run on device only after W8A8 quantization and conversion to Qualcomm DLC, and DLC models don't run in Lens Studio Preview
- Camera Kit WebFully supported
- Camera Kit MobileFully supported
Models built with TensorFlow should be converted to the TensorFlow Lite format before being imported into Lens Studio. Refer to the official TensorFlow Lite Converter guide for detailed instructions. The TensorFlow Lite converter takes a TensorFlow model and generates a TensorFlow Lite model, which is an optimized FlatBuffer format identified by the TFLite file extension.
To run on mobile devices, TensorFlow models are converted to an internal format that leverages limited computational power. Our TensorFlow converter aims to support popular neural network architectures and common neural operations.
Quantization
SnapML supports TensorFlow Lite 8-bit quantization. Learn more about Quantization on the TensorFlow website.
Check out the Multi-Class Classification Template and the corresponding training notebook to learn how to generate and quantize multi-class classification models.
When building for SPECS, an exported model runs on SPECS only after conversion to Qualcomm DLC. Convert it to TFLite and quantize it to W8A8 (int8 weights and activations, calibrated on 100–500 real inputs), then hand it to the SPECS developer team for the DLC conversion: Float32 ONNX → TFLite → W8A8 TFLite → DLC. DLC models don't run in Lens Studio Preview, so test on SPECS.