pose_detection library

On-device pose detection and landmark estimation using TensorFlow Lite.

This library provides a Flutter plugin for real-time human pose detection using Google's MediaPipe BlazePose models. It detects persons in images and extracts 33 body landmarks (keypoints) for each detected person.

Quick Start:

import 'package:pose_detection/pose_detection.dart';

final detector = PoseDetector();
await detector.initialize();

final poses = await detector.detect(imageBytes);
for (final pose in poses) {
  print('Person detected at ${pose.boundingBox}');
  if (pose.hasLandmarks) {
    final nose = pose.getLandmark(PoseLandmarkType.nose);
    print('Nose position: (${nose?.x}, ${nose?.y})');
  }
}

await detector.dispose();

Main Classes:

  • PoseDetector: Main API for pose detection
  • Pose: Detected person with bounding box and optional 33 landmarks
  • PoseLandmark: Single body keypoint with 3D coordinates and visibility
  • PoseLandmarkType: Enum of 33 body parts (nose, shoulders, knees, etc.)
  • BoundingBox: Axis-aligned rectangle for person location

Detection Modes:

Model Variants:

Classes

BoundingBox
Axis-aligned bounding box in pixel coordinates.
PerformanceConfig
Configuration for TensorFlow Lite interpreter performance.
Point
2D integer pixel coordinate.
Pose
Detected person with bounding box and optional body landmarks.
PoseDetectionDart
Dart plugin registration for pose_detection.
PoseDetector
PoseLandmark
A single body keypoint with 3D coordinates and visibility score.
PoseLandmarks
Collection of pose landmarks with confidence score (internal use).

Enums

PerformanceMode
Performance modes for TensorFlow Lite delegate selection.
PoseLandmarkModel
BlazePose model variant for landmark extraction.
PoseLandmarkType
Body part types for the 33 BlazePose landmarks.
PoseMode
Detection mode controlling the two-stage pipeline behavior.

Constants

poseLandmarkConnections → const List<List<PoseLandmarkType>>
Defines the standard skeleton connections between BlazePose landmarks.