Skip to content
pubscout

mediapipe_core

0.3.0, released 8 days ago by google.dev

Shared layer for MediaPipe task packages providing runtime, model downloads, and browser support.

WASM-ready
$ flutter pub add mediapipe_core
Source repository

What it does

Acts as the shared core layer for MediaPipe task packages. It handles the native engine across platforms, verified model downloads, an on-demand model store, and the browser runtime.

AI-written summary of version 0.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building a Flutter app that uses MediaPipe task packages like mediapipe_vision or mediapipe_text.
  • You need to bundle, verify, and download MediaPipe machine learning models.

Skip it when

  • You are not using any MediaPipe task packages in your application.
  • You are looking for a standalone machine learning or LLM client that does not depend on MediaPipe.

Strengths

  • Cross-platform support including Android, iOS, web, Windows, macOS, and Linux.
  • Provides verified model downloads with SHA-256 checks and offline bundling.

Weaknesses

  • Not intended to be imported or added directly unless your code specifically imports package:mediapipe_core/...
  • Requires platform-specific setup for things like model bundling and network permissions for downloads.

Setup

Kind
FFI (native library)
Effort
Medium
Code generation
No
Direct dependencies
12

Requires listing models in pubspec.yaml, running bundle_models script, and configuring platform permissions or entitlements if runtime downloads are enabled.

import 'package:mediapipe_vision/mediapipe_vision.dart';

Future<int> countFaces(Uint8List rgba, int width, int height) async {
  final landmarker = await FaceLandmarker.create(
    FaceLandmarkerOptions(model: VisionModels.faceLandmarker),
  );
  try {
    final result = await landmarker.detect(
      VisionImage.fromPixels(
        pixels: rgba,
        width: width,
        height: height,
        format: VisionPixelFormat.rgba,
      ),
    );
    return result.faceLandmarks.length;
  } finally {
    await landmarker.dispose();
  }
}

Alternatives

Packages that do the same job and could replace mediapipe_core.

  • ml_algo

    Native Dart implementation of machine learning algorithms and performance evaluation tools.

  • google_ml_kit

    Umbrella Flutter plugin for Google's standalone ML Kit APIs.

  • flutter_onnxruntime

    A native wrapper plugin for running ONNX Runtime models across multiple platforms.

  • onnxruntime_plus

    Flutter FFI plugin for ONNX Runtime with iOS Swift Package Manager support and cross-platform Dart bindings.

Works with

Packages commonly used together with mediapipe_core: ones it builds on, ones built on it, and its own family.