وظیفه MediaPipe Hand Landmarker به شما این امکان را می دهد که نشانه های دست ها را در یک تصویر تشخیص دهید. می توانید از این کار برای مکان یابی نقاط کلیدی دست ها و ارائه جلوه های بصری بر روی آنها استفاده کنید. این کار بر روی داده های تصویری با مدل یادگیری ماشینی (ML) به عنوان داده ایستا یا یک جریان پیوسته عمل می کند و نشانه های دستی را در مختصات تصویر، نشانه های دستی در مختصات جهانی و دستی (چپ/راست) چند دست شناسایی شده را خروجی می دهد.
استفاده از این کار را با دنبال کردن یکی از این راهنماهای پیاده سازی برای پلتفرم هدف خود شروع کنید. این راهنماهای مخصوص پلتفرم شما را از طریق اجرای اساسی این کار، از جمله یک مدل توصیه شده، و نمونه کد با گزینه های پیکربندی توصیه شده، راهنمایی می کنند:
این بخش قابلیت ها، ورودی ها، خروجی ها و گزینه های پیکربندی این کار را شرح می دهد.
ویژگی ها
پردازش تصویر ورودی - پردازش شامل چرخش تصویر، تغییر اندازه، عادی سازی و تبدیل فضای رنگی است.
آستانه امتیاز - نتایج را بر اساس نمرات پیش بینی فیلتر کنید.
ورودی های وظیفه
خروجی های وظیفه
Hand Landmarker ورودی یکی از انواع داده های زیر را می پذیرد:
تصاویر ثابت
فریم های ویدئویی رمزگشایی شده
فید ویدیوی زنده
Hand Landmarker نتایج زیر را به دست می دهد:
دستی دست های شناسایی شده
نشانه های دست های شناسایی شده در مختصات تصویر
نشانه های دست های شناسایی شده در مختصات جهان
گزینه های پیکربندی
این کار دارای گزینه های پیکربندی زیر است:
نام گزینه
توضیحات
محدوده ارزش
مقدار پیش فرض
running_mode
حالت اجرا را برای کار تنظیم می کند. سه حالت وجود دارد:
IMAGE: حالت برای ورودی های تک تصویر.
VIDEO: حالت برای فریم های رمزگشایی شده یک ویدیو.
LIVE_STREAM: حالت پخش زنده داده های ورودی، مانند دوربین. در این حالت، resultListener باید فراخوانی شود تا شنونده ای را برای دریافت نتایج به صورت ناهمزمان تنظیم کند.
{ IMAGE, VIDEO, LIVE_STREAM }
IMAGE
num_hands
حداکثر تعداد دست های شناسایی شده توسط آشکارساز نشانه دستی.
Any integer > 0
1
min_hand_detection_confidence
حداقل امتیاز اطمینان برای تشخیص دست برای موفقیت در مدل تشخیص کف دست.
0.0 - 1.0
0.5
min_hand_presence_confidence
حداقل امتیاز اطمینان برای امتیاز حضور دست در مدل تشخیص نقطه عطف دست. در حالت ویدیو و حالت پخش زنده، اگر امتیاز اطمینان حضور دست از مدل نقطه عطف دست کمتر از این آستانه باشد، Hand Landmarker مدل تشخیص کف دست را فعال میکند. در غیر این صورت، یک الگوریتم ردیابی دست سبک، مکان دست(ها) را برای تشخیص نشانه های بعدی تعیین می کند.
0.0 - 1.0
0.5
min_tracking_confidence
حداقل امتیاز اطمینان برای ردیابی دست که موفقیت آمیز در نظر گرفته شود. این آستانه جعبه محدود کننده IoU بین دست ها در فریم فعلی و آخرین فریم است. در حالت ویدیو و حالت جریان از Hand Landmarker، اگر ردیابی ناموفق باشد، Hand Landmarker تشخیص دست را فعال میکند. در غیر این صورت، تشخیص دست را نادیده می گیرد.
0.0 - 1.0
0.5
result_callback
شنونده نتیجه را طوری تنظیم می کند که وقتی نشانگر دستی در حالت پخش زنده است، نتایج تشخیص را به صورت ناهمزمان دریافت کند. فقط زمانی قابل اجراست که حالت اجرا روی LIVE_STREAM تنظیم شده باشد
N/A
N/A
مدل ها
Hand Landmarker از یک بسته مدل با دو مدل بسته بندی شده استفاده می کند: یک مدل تشخیص کف دست و یک مدل تشخیص نشانه های دستی. برای اجرای این کار به یک بسته مدل نیاز دارید که شامل هر دو مدل باشد.
بسته مدل نقطه عطف دست، مکان یابی نقطه کلیدی 21 مختصات بند انگشتی دست را در نواحی دست شناسایی شده تشخیص می دهد. این مدل بر روی تقریباً 30 هزار تصویر دنیای واقعی و همچنین چندین مدل دست مصنوعی ارائه شده در پسزمینههای مختلف آموزش داده شد.
بسته مدل نشانگر دستی شامل یک مدل تشخیص کف دست و یک مدل تشخیص نشانه های دستی است. مدل تشخیص کف دستها را در تصویر ورودی قرار میدهد و مدل تشخیص نشانههای دست، نشانههای مشخصی از دست را روی تصویر دست بریده شده که توسط مدل تشخیص کف تعریف شده است، شناسایی میکند.
از آنجایی که اجرای مدل تشخیص کف دست زمانبر است، زمانی که در حالت اجرای ویدئو یا پخش زنده است، Hand Landmarker از جعبه مرزی تعریفشده توسط مدل نشانههای دستی در یک فریم برای بومیسازی ناحیه دستها برای فریمهای بعدی استفاده میکند. Hand Landmarker تنها زمانی مدل تشخیص کف دست را دوباره فعال میکند که مدل نشانههای دست دیگر وجود دستها را شناسایی نکند یا نتواند دستها را در کادر ردیابی کند. این تعداد دفعاتی را که Hand Landmarker مدل تشخیص کف دست را ببر می کند، کاهش می دهد.
معیارهای وظیفه
در اینجا معیارهای کار برای کل خط لوله بر اساس مدل های از پیش آموزش دیده بالا آمده است. نتیجه تأخیر، متوسط تأخیر پیکسل 6 با استفاده از CPU / GPU است.
تاریخ آخرین بهروزرسانی 2025-01-13 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-01-13 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Hand landmarks detection guide\n\nThe MediaPipe Hand Landmarker task lets you detect the landmarks of the hands in an image.\nYou can use this task to locate key points of hands and render visual effects on\nthem. This task operates on image data with a machine learning (ML) model as\nstatic data or a continuous stream and outputs hand landmarks in image\ncoordinates, hand landmarks in world coordinates and handedness(left/right hand)\nof multiple detected hands.\n\n[Try it!arrow_forward](https://mediapipe-studio.webapps.google.com/demo/hand_landmarker)\n\nGet Started\n-----------\n\nStart using this task by following one of these implementation guides for your\ntarget platform. These platform-specific guides walk you through a basic\nimplementation of this task, including a recommended model, and code example\nwith recommended configuration options:\n\n- **Android** - [Code\n example](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/hand_landmarker/android)\n - [Guide](./android)\n- **Python** - [Code\n example](https://colab.research.google.com/github/googlesamples/mediapipe/blob/main/examples/hand_landmarker/python/hand_landmarker.ipynb)\n - [Guide](./python)\n- **Web** - [Code example](https://codepen.io/mediapipe-preview/pen/gOKBGPN) - [Guide](./web_js)\n\nTask details\n------------\n\nThis section describes the capabilities, inputs, outputs, and configuration\noptions of this task.\n\n### Features\n\n- **Input image processing** - Processing includes image rotation, resizing, normalization, and color space conversion.\n- **Score threshold** - Filter results based on prediction scores.\n\n| Task inputs | Task outputs |\n|----------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| The Hand Landmarker accepts an input of one of the following data types: - Still images \u003c!-- --\u003e - Decoded video frames \u003c!-- --\u003e - Live video feed | The Hand Landmarker outputs the following results: - Handedness of detected hands \u003c!-- --\u003e - Landmarks of detected hands in image coordinates \u003c!-- --\u003e - Landmarks of detected hands in world coordinates |\n\n### Configurations options\n\nThis task has the following configuration options:\n\n| Option Name | Description | Value Range | Default Value |\n|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|---------------|\n| `running_mode` | Sets the running mode for the task. There are three modes: \u003cbr /\u003e IMAGE: The mode for single image inputs. \u003cbr /\u003e VIDEO: The mode for decoded frames of a video. \u003cbr /\u003e LIVE_STREAM: The mode for a livestream of input data, such as from a camera. In this mode, resultListener must be called to set up a listener to receive results asynchronously. | {`IMAGE, VIDEO, LIVE_STREAM`} | `IMAGE` |\n| `num_hands` | The maximum number of hands detected by the Hand landmark detector. | `Any integer \u003e 0` | `1` |\n| `min_hand_detection_confidence` | The minimum confidence score for the hand detection to be considered successful in palm detection model. | `0.0 - 1.0` | `0.5` |\n| `min_hand_presence_confidence` | The minimum confidence score for the hand presence score in the hand landmark detection model. In Video mode and Live stream mode, if the hand presence confidence score from the hand landmark model is below this threshold, Hand Landmarker triggers the palm detection model. Otherwise, a lightweight hand tracking algorithm determines the location of the hand(s) for subsequent landmark detections. | `0.0 - 1.0` | `0.5` |\n| `min_tracking_confidence` | The minimum confidence score for the hand tracking to be considered successful. This is the bounding box IoU threshold between hands in the current frame and the last frame. In Video mode and Stream mode of Hand Landmarker, if the tracking fails, Hand Landmarker triggers hand detection. Otherwise, it skips the hand detection. | `0.0 - 1.0` | `0.5` |\n| `result_callback` | Sets the result listener to receive the detection results asynchronously when the hand landmarker is in live stream mode. Only applicable when running mode is set to `LIVE_STREAM` | N/A | N/A |\n\nModels\n------\n\nThe Hand Landmarker uses a model bundle with two packaged models: a palm detection\nmodel and a hand landmarks detection model. You need a model bundle that\ncontains both these models to run this task.\n| **Attention:** This MediaPipe Solutions Preview is an early release. [Learn more](/edge/mediapipe/solutions/about#notice).\n\n| Model name | Input shape | Quantization type | Model Card | Versions |\n|----------------------------------------------------------------------------------------------------------------------------------------------|----------------------|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [HandLandmarker (full)](https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/latest/hand_landmarker.task) | 192 x 192, 224 x 224 | float 16 | [info](https://storage.googleapis.com/mediapipe-assets/Model%20Card%20Hand%20Tracking%20(Lite_Full)%20with%20Fairness%20Oct%202021.pdf) | [Latest](https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/latest/hand_landmarker.task) |\n\nThe hand landmark model bundle detects the keypoint localization of 21\nhand-knuckle coordinates within the detected hand regions. The model was trained\non approximately 30K real-world images, as well as several rendered synthetic\nhand models imposed over various backgrounds.\n\nThe hand landmarker model bundle contains a palm detection model and a hand\nlandmarks detection model. The Palm detection model locates hands within the\ninput image, and the hand landmarks detection model identifies specific hand\nlandmarks on the cropped hand image defined by the palm detection model.\n\nSince running the palm detection model is time consuming, when in video or live\nstream running mode, Hand Landmarker uses the bounding box defined by the hand\nlandmarks model in one frame to localize the region of hands for subsequent\nframes. Hand Landmarker only re-triggers the palm detection model if the hand\nlandmarks model no longer identifies the presence of hands or fails to track the\nhands within the frame. This reduces the number of times Hand Landmarker tiggers\nthe palm detection model.\n\nTask benchmarks\n---------------\n\nHere's the task benchmarks for the whole pipeline based on the above pre-trained\nmodels. The latency result is the average latency on Pixel 6 using CPU / GPU.\n\n| Model Name | CPU Latency | GPU Latency |\n|-----------------------|-------------|-------------|\n| HandLandmarker (full) | 17.12ms | 12.27ms |"]]