MediaPipeSharp 1.1.7

dotnet add package MediaPipeSharp --version 1.1.7
                    
NuGet\Install-Package MediaPipeSharp -Version 1.1.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MediaPipeSharp" Version="1.1.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MediaPipeSharp" Version="1.1.7" />
                    
Directory.Packages.props
<PackageReference Include="MediaPipeSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MediaPipeSharp --version 1.1.7
                    
#r "nuget: MediaPipeSharp, 1.1.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MediaPipeSharp@1.1.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MediaPipeSharp&version=1.1.7
                    
Install as a Cake Addin
#tool nuget:?package=MediaPipeSharp&version=1.1.7
                    
Install as a Cake Tool

MediaPipeSharp

MediaPipe inference library for .NET based on OpenVINO C# API (guojin-yan / JYPPX) and OpenCvSharp4.

Provides ready-to-use wrappers for the MediaPipe models from opencv_zoo:

Module Class Input Output
Palm Detection PalmDetector Image Bounding box + 7 palm landmarks
Hand Pose HandPoseEstimator Image + PalmDetectionResult 21 landmarks (screen + world) + handedness
Person Detection PersonDetector Image Bounding box + 4 body keypoints
Pose Estimation PoseEstimator Image + PersonDetectionResult 39 landmarks (screen + world) + segmentation mask

Supported frameworks

net48, net6.0, net8.0, net9.0, net10.0

.NET Framework 4.8 notes

  • The native libraries ship for win-x64 only. Set <PlatformTarget>x64</PlatformTarget> (do not enable Prefer32Bit), otherwise the process starts as 32-bit and DllNotFoundException is thrown.
  • With PackageReference no manual setup is needed: OpenCvSharpExtern.dll, opencv_videoio_ffmpeg*.dll, openvino*.dll and tbb*.dll are copied to the output directory automatically.
  • Old-style packages.config projects do not resolve runtimes/ native assets, so those DLLs must be copied to the output directory manually. PackageReference is recommended.

Dependencies

  • JYPPX.OpenVINO.CSharp.API (>= 3.3.1) — OpenVINO C# wrapper by guojin-yan
  • OpenVINO.runtime.win — native OpenVINO runtime
  • OpenCvSharp4 (4.13.x) + OpenCvSharp4.runtime.win

Installation

dotnet add package MediaPipeSharp

Model download

The models are not bundled in the NuGet package. Download them from opencv_zoo or use the OpenVINO model downloader:

palm_detection_mediapipe.onnx
handpose_estimation_mediapipe.onnx
person_detection_mediapipe.onnx
pose_estimation_mediapipe.onnx

Quick start

using OpenCvSharp;
using MediaPipeSharp.Palm;
using MediaPipeSharp.Hand;

// --- Palm detection ---
using var palm = new PalmDetector("palm_detection_mediapipe.onnx", "CPU");
using var image = Cv2.ImRead("hand.jpg");
palm.InferImage(image);
foreach (var r in palm.Results)
{
    Console.WriteLine($"Palm score={r.Score:F3} box={r.BoundingBox}");
}

// --- Hand pose (requires a palm detection) ---
if (palm.Results.Count > 0)
{
    using var hand = new HandPoseEstimator("handpose_estimation_mediapipe.onnx", "CPU");
    hand.Infer(image, palm.Results[0]);
    var pose = hand.Result;
    if (pose != null)
    {
        Console.WriteLine($"Hand: {pose.Handedness}, conf={pose.Confidence:F3}");
        foreach (var lm in pose.Landmarks)
            Console.WriteLine($"  ({lm.X:F3}, {lm.Y:F3}, z={lm.Z:F3})");
    }
}

Person & Pose

using MediaPipeSharp.Person;
using MediaPipeSharp.Pose;

using var person = new PersonDetector("person_detection_mediapipe.onnx", "GPU");
person.InferImage(image);
if (person.Results.Count > 0)
{
    using var pose = new PoseEstimator("pose_estimation_mediapipe.onnx", "GPU");
    pose.Infer(image, person.Results[0]);
    var r = pose.Result;
    if (r != null)
    {
        Console.WriteLine($"Pose conf={r.Confidence:F3}, landmarks={r.Landmarks.Length}");
        if (r.SegmentationMask != null)
            Cv2.ImWrite("mask.png", r.SegmentationMask);
    }
}

Visualization

MediaPipeSharp.Visualization draws results onto a BGR Mat. Results carry normalized coordinates, so the helpers only need the target image.

using MediaPipeSharp.Visualization;

using var vis = image.Clone();
ResultRenderer.DrawPalm(vis, palmResult);   // box + 7 landmarks
ResultRenderer.DrawHand(vis, handResult);   // box + 21 landmarks + skeleton
Cv2.ImWrite("hand_vis.jpg", vis);
Method Draws
DrawPalm bounding box, 7 palm landmarks, palm connections, score
DrawHand bounding box, 21 hand landmarks, 21 bone connections, confidence
DrawPerson 4 person landmarks (the raw region box is a head/upper-chest region, not a body box, so it is not drawn)
DrawPose segmentation mask, box, 33 body landmarks + skeleton (low-visibility points skipped)
DrawSegmentationMask blends a single channel mask onto an image

Style is configurable through DrawOptions (colors, point radius, line thickness, mask alpha, visibility threshold). Connection tables are public: PalmConnections, HandConnections, PoseConnections.

Device selection

Pass any OpenVINO device name: "CPU", "GPU", "NPU", "AUTO", etc.

License

Apache-2.0

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.7 76 11/11/2026
1.0.0 79 11/11/2026