google_mlkit_subject_segmentation
0.3.2, released 10 days ago by flutter-ml.dev
Flutter plugin for Google's ML Kit Subject Segmentation API to separate subjects from backgrounds.
What it does
A Flutter plugin that uses Google's ML Kit Subject Segmentation API to easily separate multiple subjects from the background in a picture. It provides masks and bitmaps for individual subjects as well as foreground processing, handling objects, pets, and humans.
AI-written summary of version 0.3.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to separate multiple subjects from backgrounds in static images on mobile.
- You want to build features like sticker creation or background swapping.
- You require on-device image processing to preserve user privacy.
Skip it when
- You need support for web or desktop platforms.
- You require iOS support for subject segmentation (currently only available for Android in beta).
Strengths
- On-device processing preserving user privacy.
- Supports multi-subject segmentation with confidence masks and bitmaps.
- Uses Google's native ML Kit APIs via platform channels.
Weaknesses
- iOS support is not currently available for subject segmentation.
- Feature is still in Beta and limited to static images.
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 1
Requires minimum Android SDK requirements (minSdkVersion: 24, targetSdkVersion: 36, compileSdkVersion: 36) and optional AndroidManifest.xml dependency declarations for model downloading.
final options = SubjectSegmenterOptions(
enableForegroundBitmap: false,
enableForegroundConfidenceMask: true,
enableMultipleSubjects: SubjectResultOptions(
enableConfidenceMask: true,
enableSubjectBitmap: false,
),
);
final segmenter = SubjectSegmenter(options: options);
final result = await segmenter.processImage(inputImage);
segmenter.close();Alternatives
Packages that do the same job and could replace google_mlkit_subject_segmentation.
- native_cutout
On-device background removal for iOS and Android using native vision and segmentation APIs.
59Compare
Works with
Packages commonly used together with google_mlkit_subject_segmentation: ones it builds on, ones built on it, and its own family.
- google_mlkit_commonsgoogle_mlkit_subject_segmentation depends on itCommon classes and utility methods for Google's ML Kit plugins
- google_mlkit_text_recognitionSame familyFlutter plugin to use Google's ML Kit Text Recognition on Android and iOS.
- google_mlkit_barcode_scanningSame familyA Flutter plugin to use Google's ML Kit Barcode Scanning on Android and iOS.
- google_mlkit_face_detectionSame familyFlutter plugin to use Google's ML Kit Face Detection on iOS and Android.
- google_mlkit_translationSame familyFlutter plugin for Google's ML Kit On-Device Translation.
- google_mlkit_selfie_segmentationSame familyFlutter plugin to use Google's ML Kit Selfie Segmentation API.
- google_mlkit_language_idSame familyDetermine the language of a text string using Google's ML Kit.
- google_mlkit_pose_detectionSame familyFlutter plugin for Google ML Kit Pose Detection on Android and iOS.