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.
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.
82Compare - google_ml_kit
Umbrella Flutter plugin for Google's standalone ML Kit APIs.
86Compare - flutter_onnxruntime
A native wrapper plugin for running ONNX Runtime models across multiple platforms.
79Compare - onnxruntime_plus
Flutter FFI plugin for ONNX Runtime with iOS Swift Package Manager support and cross-platform Dart bindings.
69Compare
Works with
Packages commonly used together with mediapipe_core: ones it builds on, ones built on it, and its own family.
- archivemediapipe_core depends on itEncodes and decodes archive and compression formats such as zip, tar, gzip, and zlib.
- yamlmediapipe_core depends on itA Dart library for parsing YAML documents into Dart data structures.
- cryptomediapipe_core depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- webmediapipe_core depends on itLightweight bindings for browser APIs via JS interop
- hooksmediapipe_core depends on itDart API for the JSON-based protocol for package build and link hooks.
- code_assetsmediapipe_core depends on itProvides the hook protocol specification for bundling native code with Dart packages.
- ffimediapipe_core depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- path_providermediapipe_core depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.