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.

Usage

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(
  mode: SegmenterMode.stream,
  enableRawSizeMask: true,
);

Process image

final mask = await segmenter.processImage(inputImage);

Release resources with close()

segmenter.close();

Example app

Find the example app here.

Contributing

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.

Libraries

google_mlkit_selfie_segmentation