MediaPipeSharp 1.1.7
dotnet add package MediaPipeSharp --version 1.1.7
NuGet\Install-Package MediaPipeSharp -Version 1.1.7
<PackageReference Include="MediaPipeSharp" Version="1.1.7" />
<PackageVersion Include="MediaPipeSharp" Version="1.1.7" />
<PackageReference Include="MediaPipeSharp" />
paket add MediaPipeSharp --version 1.1.7
#r "nuget: MediaPipeSharp, 1.1.7"
#:package MediaPipeSharp@1.1.7
#addin nuget:?package=MediaPipeSharp&version=1.1.7
#tool nuget:?package=MediaPipeSharp&version=1.1.7
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 enablePrefer32Bit), otherwise the process starts as 32-bit andDllNotFoundExceptionis thrown. - With
PackageReferenceno manual setup is needed:OpenCvSharpExtern.dll,opencv_videoio_ffmpeg*.dll,openvino*.dllandtbb*.dllare copied to the output directory automatically. - Old-style
packages.configprojects do not resolveruntimes/native assets, so those DLLs must be copied to the output directory manually.PackageReferenceis recommended.
Dependencies
JYPPX.OpenVINO.CSharp.API(>= 3.3.1) — OpenVINO C# wrapper by guojin-yanOpenVINO.runtime.win— native OpenVINO runtimeOpenCvSharp4(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 | Versions 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. |
-
.NETFramework 4.8
- JYPPX.OpenVINO.CSharp.API (>= 3.3.1)
- OpenCvSharp4 (>= 4.13.0.20260627)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260627)
- OpenVINO.runtime.win (>= 2026.4.0)
-
net10.0
- JYPPX.OpenVINO.CSharp.API (>= 3.3.1)
- OpenCvSharp4 (>= 4.13.0.20260627)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260627)
- OpenVINO.runtime.win (>= 2026.4.0)
-
net6.0
- JYPPX.OpenVINO.CSharp.API (>= 3.3.1)
- OpenCvSharp4 (>= 4.13.0.20260627)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260627)
- OpenVINO.runtime.win (>= 2026.4.0)
-
net8.0
- JYPPX.OpenVINO.CSharp.API (>= 3.3.1)
- OpenCvSharp4 (>= 4.13.0.20260627)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260627)
- OpenVINO.runtime.win (>= 2026.4.0)
-
net9.0
- JYPPX.OpenVINO.CSharp.API (>= 3.3.1)
- OpenCvSharp4 (>= 4.13.0.20260627)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260627)
- OpenVINO.runtime.win (>= 2026.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.