components/background_components/segmenter/segmenter_mobile library

Mobile/Desktop Segmenter - Uses native implementations for supported platforms

iOS: Calls native MediaPipe plugin for real segmentation (preview shows VB effect) macOS: Calls native Vision framework for real segmentation (preview shows VB effect) Windows: Calls native ONNX Runtime plugin for real segmentation (preview shows VB effect) Android: Stub implementation (add google_mlkit_selfie_segmentation to your app)

For virtual backgrounds:

  • iOS: Uses native MediaPipe plugin (VirtualBackgroundPlugin.swift)
  • macOS: Uses native Vision plugin (VirtualBackgroundPlugin.swift)
  • Windows: Uses native ONNX Runtime plugin (virtual_background_plugin.cpp)
  • Android: Add google_mlkit_selfie_segmentation to your app's pubspec.yaml

If you need ML Kit on Android, create a custom segmenter implementation in your app that imports google_mlkit_selfie_segmentation directly.

Classes

MobileSegmenter
Mobile/Desktop segmenter - Native MediaPipe on iOS, Vision on macOS, ONNX on Windows, stub on Android

Functions

createSegmenter() BackgroundSegmenterBase
Factory function for conditional imports