Google's ML Kit Selfie Segmentation for Flutter

Pub Version analysis Star on Github License: MIT

A Flutter plugin to use Google's ML Kit Selfie Segmentation API to easily separate the background from users within a scene and focus on what matters.

Getting Started

Before you get started read about the requirements and known issues of this plugin here.


Selfie Segmenter

Create an instance of InputImage

Create an instance of InputImage as explained here.

final InputImage inputImage;

Create an instance of SelfieSegmenter

final segmenter = SelfieSegmenter(
  enableRawSizeMask: true,

Process image

final mask = await segmenter.processImage(inputImage);

Release resources with close()


Example app

Find the example app here.


Contributions are welcome. In case of any problems look at existing issues, if you cannot find anything related to your problem then open an issue. Create an issue before opening a pull request for non trivial fixes. In case of trivial fixes open a pull request directly.