Skip to content

Navigation Menu

Sign in
Sign up
This repository was archived by the owner on Jun 2, 2024. It is now read-only.

Repository files navigation

MLKitPoseDetection

This is a snippet of a Flutter iOS Method Channel for Pose Detection using MLKit.

RPReplay_Final1687757878.mov

Introduction

The snippet in this repository allows Flutter apps to leverage the capabilities of Google's ML Kit's Pose Detection API. The package supports pose detection in "real-time". Note that there is notable latency using this implementation strategy, hence the "real time" in quotes.

Features

  • Real-time pose detection
  • Extract 33 skeletal landmark points

Installation

To use this package, add MLKitPoseDetection as a dependency in your podfile.

Assemble these files in your codebase as you see fit, then in a Stateful widget, include this snippet:

...
late List<Offset> results = [];
@override
void initState() {
 super.initState();
 try {
 widget.cameraController!.startVideoRecording(onAvailable: (image) async {
 final data = await widget.inferenceService.getPoseDetection(image);
 if (mounted && data is List<Offset> && data.isNotEmpty) {
 setState(
 () => results = data,
 );
 }
 });
 } catch (e) {
 log("An error occured in the Inference Preview $e");
 }
}
...

Finally, use the widget.cameraController in a CameraPreview widget.

License

This project is licensed under the MIT License.

About

Pose Detection for Flutter using iOS MLKit πŸ“± πŸ–Ό πŸ•Ί

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /