مفاهيم اكتشاف الوجه
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تحدد ميزة "التعرّف على الوجوه" الوجوه البشرية في الوسائط المرئية، مثل الصور الرقمية أو الفيديوهات. وعند التعرّف على وجه معيّن، يكون له وضع وحجم واتجاه مرتبطان به، ويمكن البحث عنه عن معالم مثل العينين والأنف.
في ما يلي بعض المصطلحات التي نستخدمها في ما يتعلق بميزة "التعرّف على الوجوه" في أدوات تعلّم الآلة:
تعمل ميزة تتبُّع الوجه على توسيع نطاق ميزة "التعرّف على الوجوه" لتشمل تسلسلات الفيديوهات. يمكن تتبّع أي وجه يظهر في فيديو لأي مدة زمنية من إطار إلى آخر.
ويعني ذلك أنّه يمكن تحديد الوجه الذي يتم التعرّف عليه في إطارات الفيديو المتتالية على أنّه الشخص نفسه. يُرجى العِلم أنّ هذه الميزة ليست من أشكال التعرّف على الوجه، إذ إنّ ميزة تتبُّع الوجوه لا تقدّم استنتاجات تستند إلى موضع الوجوه وحركتها في تسلسل الفيديو.
المَعلم هو نقطة اهتمام في وجه. العين اليسرى والعين اليمنى
وقاعدة الأنف كلها أمثلة على المعالم. وتتيح هذه الأدوات إمكانية العثور على المعالم على وجه تم التعرّف عليه.
الخطوط هي مجموعة من النقاط التي تتبع شكل ملامح الوجه.
تتيح أدوات تعلّم الآلة إمكانية تحديد محيط الوجه.
يحدد التصنيف ما إذا كانت خاصية معينة للوجه موجودة. على سبيل المثال، يمكن تصنيف الوجه حسب
ما إذا كانت عينيه مفتوحتين أو مغلقتين، أو ما إذا كان الوجه يبتسم أم لا.
اتجاه الوجه
تصف المصطلحات التالية الزاوية التي يتم توجيه الوجه إليها في ما يتعلق بالكاميرا:
- أويلر س: وجه لزاوية أويلر س الموجبة موجَّهة للأعلى.
- أويلر ص: وجه ذو زاوية أويلر ص موجبة ينظر إلى يمين الكاميرا أو إلى اليسار إذا كان سالبًا.
- أويلر ع: يتم تدوير وجه بزاوية أويلر Z موجبة في عكس اتجاه عقارب الساعة بالنسبة إلى الكاميرا.
لا تُبلِّغ مجموعة أدوات تعلّم الآلة عن زاوية Euler X أو Euler Y أو Euler Z للوجه الذي تم رصده عند ضبط
LANDMARK_MODE_NONE
وCONTOUR_MODE_ALL
وCLASSIFICATION_MODE_NONE
وPERFORMANCE_MODE_FAST
مع بعضها.
المَعالم
المعلم هو نقطة اهتمام داخل وجه. العين اليسرى والعين اليمنى
وقاعدة الأنف كلها أمثلة على المعالم.
ترصد هذه الأداة الوجوه بدون البحث عن المعالم.
ميزة "رصد المعالم" هي خطوة اختيارية يتم إيقافها تلقائيًا.
يلخص الجدول التالي جميع المعالم التي يمكن اكتشافها بالنظر إلى زاوية أويلر ص للوجه المرتبط:
زاوية أويلر ص |
المَعالم التي يمكن رصدها |
< -36 درجة |
العين اليسرى، الفم الأيسر، الأذن اليسرى، قاعدة الأنف، الخد الأيسر |
من -36 درجة إلى -12 درجة |
الفم الأيسر، قاعدة الأنف، أسفل الفم، العين اليمنى، العين اليسرى، الخد الأيسر، رأس الأذن اليسرى |
من -12 درجة إلى 12 درجة |
العين اليمنى، العين اليسرى، قاعدة الأنف، الخد الأيسر، الخد الأيمن، الفم الأيسر، الفم الأيمن، أسفل الفم |
12 درجة إلى 36 درجة |
الفم الأيمن، قاعدة الأنف، أسفل الفم، العين اليسرى، العين اليمنى، الخد الأيمن، رأس الأذن الأيمن |
> 36 درجة |
العين اليمنى، الفم الأيمن، الأذن اليمنى، قاعدة الأنف، الخد الأيمن |
يتضمّن كل مَعلم تم رصده موضعه المرتبط في الصورة.
خطوط كونتورية
تحديد الوجه هو مجموعة من النقاط التي تمثل شكل ميزة الوجه. توضح الصورة التالية كيفية تحديد هذه النقاط بوجه. انقر فوق الصورة
لتكبيرها:
يتم تمثيل كل محيط ميزة ترصده أدوات تعلّم الآلة بعدد ثابت من النقاط:
بيضاوي للوجه |
36 نقطة |
الشفة العلوية (العلوية) |
11 نقطة |
الحاجب الأيسر (أعلى) |
5 نقاط |
الشفة العلوية (السفلى) |
9 نقاط |
الحاجب الأيسر (أسفل) |
5 نقاط |
الشفة السفلى (العلوية) |
9 نقاط |
الحاجب الأيمن (أعلى) |
5 نقاط |
الشفة السفلى (السفلى) |
9 نقاط |
الحاجب الأيمن (أسفل) |
5 نقاط |
جسر أنف |
نقطتان |
العين اليسرى |
16 نقطة |
أسفل الأنف |
3 نقاط |
العين اليمنى |
16 نقطة |
الخد الأيسر (في الوسط) |
نقطة واحدة |
الخد الأيمن (المنتصف) |
نقطة واحدة |
عند الحصول على جميع خطوط الوجه في وقت واحد، ستحصل على صفيف من 133 نقطة،
وتظهر خطوط عليها كما هو موضح أدناه:
مؤشرات خطوط الخصائص |
0-35 |
بيضاوي للوجه |
36-40 |
الحاجب الأيسر (أعلى) |
41-45 |
الحاجب الأيسر (أسفل) |
46-50 |
الحاجب الأيمن (أعلى) |
51-55 |
الحاجب الأيمن (أسفل) |
56-71 |
العين اليسرى |
72-87 |
العين اليمنى |
88-96 |
الشفة العلوية (السفلى) |
97-105 |
الشفة السفلى (العلوية) |
106-116 |
الشفة العلوية (العلوية) |
117-125 |
الشفة السفلى (السفلى) |
126، 127 |
جسر أنف |
128-130 |
أسفل الأنف (لاحظ أن النقطة المركزية عند المؤشر 128) |
131 |
الخد الأيسر (في الوسط) |
132 |
الخد الأيمن (المنتصف) |
التصنيف
يحدد التصنيف ما إذا كانت هناك خصائص وجه معينة موجودة.
تتوافق حزمة تعلُّم الآلة حاليًا مع فئتَين: العيون مفتوحة والابتسام.
التصنيف هو قيمة مؤكدة. إنه يشير إلى الثقة في
وجود سمات الوجه. على سبيل المثال، تشير القيمة 0.7 أو أكثر
لتصنيف الابتسام إلى أنه من المحتمل أن يكون الشخص مبتسمًا.
ويعتمد هذَين التصنيفَين على رصد المعالم.
تجدر الإشارة أيضًا إلى أنّ تصنيفَي "العيون مفتوحة" و "الابتسامة" يناسبان فقط
الوجوه الأمامية، أي الوجوه ذات زاوية أويلر Y الصغيرة (بين 18 و18 درجة).
الحد الأدنى لحجم الوجه
الحد الأدنى لحجم الوجه هو حجم الوجه المطلوب، معبرًا عنه بنسبة عرض الرأس إلى عرض الصورة. على سبيل المثال، تعني القيمة 0.1 أن أصغر وجه يمكن البحث عنه يساوي 10% تقريبًا من عرض الصورة التي يتم البحث عنها.
إنّ الحد الأدنى لحجم الوجه هو المفاضلة بين الأداء والدقة: فضبط الحدّ الأدنى للحجم الأصغر حجمًا يتيح لأداة الرصد العثور على وجوه أصغر حجمًا، ولكنّ عملية الرصد ستستغرق وقتًا أطول. قد يؤدي ضبطها على حجم أكبر إلى استبعاد الوجوه الأصغر حجمًا، ولكنّها ستعمل بشكل أسرع.
إنّ الحدّ الأدنى لحجم الوجه ليس حدًا صارمًا، إذ قد ترصد أداة الرصد وجوهًا أصغر قليلاً من الحجم المحدد.
الخطوات التالية
استخدام ميزة "التعرّف على الوجه" في تطبيق iOS أو Android:
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-09-04 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-09-04 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eML Kit's face detection feature locates and analyzes human faces in images and videos, identifying position, size, orientation, and facial landmarks like eyes and nose.\u003c/p\u003e\n"],["\u003cp\u003eFace tracking in ML Kit follows faces across video frames, enabling the identification of the same person without using facial recognition.\u003c/p\u003e\n"],["\u003cp\u003eOptional features include landmark detection (identifying points like eyes, nose, mouth), contour detection (outlining facial features), and classification (detecting smiles or open eyes).\u003c/p\u003e\n"],["\u003cp\u003ePerformance can be adjusted by setting the minimum face size, balancing speed and accuracy of detection.\u003c/p\u003e\n"]]],[],null,["Face detection locates human faces in visual media such as digital images or\nvideo. When a face is detected it has an associated position, size, and\norientation; and it can be searched for landmarks such as the eyes and nose.\n\nHere are some of the terms that we use regarding the face detection feature\nof ML Kit:\n\n- **Face tracking** extends face detection to video sequences. Any face that\n appears in a video for any length of time can be tracked from frame to frame.\n This means a face detected in consecutive video frames can be identified as\n being the same person. Note that this isn't a form of *face recognition*; face\n tracking only makes inferences based on the position and motion of the faces in\n a video sequence.\n\n- A **landmark** is a point of interest within a face. The left eye, right eye,\n and base of the nose are all examples of landmarks. ML Kit provides the\n ability to find landmarks on a detected face.\n\n- A **contour** is a set of points that follow the shape of a facial feature.\n ML Kit provides the ability to find the contours of a face.\n\n- **Classification** determines whether a certain facial\n characteristic is present. For example, a face can be classified by\n whether its eyes are open or closed, or if the face is smiling or not.\n\nFace orientation\n\nThe following terms describe the angle a face is oriented with respect to the\ncamera:\n\n- **Euler X**: A face with a positive Euler X angle is facing upward.\n- **Euler Y**: A face with a positive Euler Y angle is looking to the right of the camera, or looking to the left if negative.\n- **Euler Z**: A face with a positive Euler Z angle is rotated counter-clockwise relative to the camera.\n\nML Kit doesn't report the Euler X, Euler Y or Euler Z angle of a detected face when\n`LANDMARK_MODE_NONE`, `CONTOUR_MODE_ALL`, `CLASSIFICATION_MODE_NONE` and\n`PERFORMANCE_MODE_FAST`are set together.\n\nLandmarks\n\nA landmark is a point of interest within a face. The left eye, right eye, and\nnose base are all examples of landmarks.\n\nML Kit detects faces without looking for landmarks.\nLandmark detection is an optional step that is disabled by default.\n\nThe following table summarizes all of the landmarks that can be detected given\nthe Euler Y angle of an associated face:\n\n| Euler Y angle | Detectable landmarks |\n|----------------------------|------------------------------------------------------------------------------------------------|\n| \\\u003c -36 degrees | left eye, left mouth, left ear, nose base, left cheek |\n| -36 degrees to -12 degrees | left mouth, nose base, bottom mouth, right eye, left eye, left cheek, left ear tip |\n| -12 degrees to 12 degrees | right eye, left eye, nose base, left cheek, right cheek, left mouth, right mouth, bottom mouth |\n| 12 degrees to 36 degrees | right mouth, nose base, bottom mouth, left eye, right eye, right cheek, right ear tip |\n| \\\u003e 36 degrees | right eye, right mouth, right ear, nose base, right cheek |\n\nEach detected landmark includes its associated position in the image.\n\nContours\n\nA contour is a set of points that represent the shape of a facial feature. The\nfollowing image illustrates how these points map to a face. Click the image to\nenlarge it:\n\n[](/static/ml-kit/vision/face-detection/images/face_contours.svg)\n\nEach feature contour that ML Kit detects is represented by a fixed number of\npoints:\n\n| Face oval | 36 points | Upper lip (top) | 11 points |\n| Left eyebrow (top) | 5 points | Upper lip (bottom) | 9 points |\n| Left eyebrow (bottom) | 5 points | Lower lip (top) | 9 points |\n| Right eyebrow (top) | 5 points | Lower lip (bottom) | 9 points |\n| Right eyebrow (bottom) | 5 points | Nose bridge | 2 points |\n| Left eye | 16 points | Nose bottom | 3 points |\n| Right eye | 16 points |\n| Left cheek (center) | 1 point |\n| Right cheek (center) | 1 points |\n|------------------------|-----------|--------------------|-----------|\n\nWhen you get all of a face's contours at once, you get an array of 133 points,\nwhich map to feature contours as shown below:\n\n| Indexes of feature contours ||\n|----------|----------------------------------------------------------|\n| 0-35 | Face oval |\n| 36-40 | Left eyebrow (top) |\n| 41-45 | Left eyebrow (bottom) |\n| 46-50 | Right eyebrow (top) |\n| 51-55 | Right eyebrow (bottom) |\n| 56-71 | Left eye |\n| 72-87 | Right eye |\n| 88-96 | Upper lip (bottom) |\n| 97-105 | Lower lip (top) |\n| 106-116 | Upper lip (top) |\n| 117-125 | Lower lip (bottom) |\n| 126, 127 | Nose bridge |\n| 128-130 | Nose bottom (note that the center point is at index 128) |\n| 131 | Left cheek (center) |\n| 132 | Right cheek (center) |\n\nClassification\n\nClassification determines whether a certain facial characteristic is present.\nML Kit currently supports two classifications: **eyes open** and **smiling**.\n\nClassification is a certainty value. It indicates the confidence\nthat a facial characteristic is present. For example, a value of 0.7 or more\nfor the smiling classification indicates that it's likely that a person is\nsmiling.\n\nBoth of these classifications rely upon landmark detection.\n\nAlso note that the classifications \"eyes open\" and \"smiling\" only work for\nfrontal faces, i.e., faces with a small Euler Y angle (between -18 and 18\ndegrees).\n\nMinimum Face Size\n\nThe minimum face size is the desired face size, expressed as the ratio of the width of\nthe head to the width of the image. For example, the value of 0.1 means that\nthe smallest face to search for is roughly 10% of the width of the image being\nsearched.\n\nThe minimum face size is a performance vs. accuracy trade-off: setting the\nminimum size smaller lets the detector find smaller faces but detection\nwill take longer; setting it larger might exclude smaller faces but\nwill run faster.\n\nThe minimum face size is not a hard limit; the detector may find faces slightly\nsmaller than specified.\n\nNext Steps\n\nUse face detection in your iOS or Android app:\n\n- [iOS](/ml-kit/vision/face-detection/ios)\n- [Android](/ml-kit/vision/face-detection/android)"]]