---
description: Unofficial Capacitor plugin for Google ML Kit Face Detection SDK to detect faces in images with support for Android and iOS.
title: Capacitor ML Kit Face Detection Plugin for Android & iOS - Capawesome
image: https://capawesome.io/docs/assets/images/social/sdks/capacitor/mlkit/face-detection.png
---

<!doctype html> 

[Skip to content ](#capacitor-ml-kit-face-detection-plugin) 

[🖥️ Introducing the **Capacitor Electron Platform** — build desktop apps for macOS, Windows, and Linux. Free & open source. ](/blog/announcing-the-capacitor-electron-platform/) 

* [ SDKs ](/docs/sdks/)
* [ Formbricks ](/docs/sdks/capacitor/formbricks/)
* [ Geocoder ](/docs/sdks/capacitor/geocoder/)
* [ Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [ Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [ Gyroscope ](/docs/sdks/capacitor/gyroscope/)
* [ Haptics ](/docs/sdks/capacitor/haptics/)
* [ Home Indicator ](/docs/sdks/capacitor/home-indicator/)
* [ In-App Browser ](/docs/sdks/capacitor/in-app-browser/)
* [ Install Referrer ](/docs/sdks/capacitor/install-referrer/)
* [ Intercom ](/docs/sdks/capacitor/intercom/)
* [ Intune ](/docs/sdks/capacitor/intune/)
* [ Keep Awake ](/docs/sdks/capacitor/keep-awake/)
* [ libSQL ](/docs/sdks/capacitor/libsql/)
* [ Light Sensor ](/docs/sdks/capacitor/light-sensor/)
* [ Live Update ](/docs/sdks/capacitor/live-update/)
* [ Localization ](/docs/sdks/capacitor/localization/)
* [ Mail Composer ](/docs/sdks/capacitor/mail-composer/)
* [ Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [ Maps Launcher ](/docs/sdks/capacitor/maps-launcher/)
* [ Media Session ](/docs/sdks/capacitor/media-session/)
* [ ML Kit ](/docs/sdks/capacitor/mlkit/)
* [ iOS ](#ios)
* [ Configuration ](#configuration)
* [ Demo ](#demo)
* [ Usage ](#usage)
* [ API ](#api)
* [ Enums ](#enums)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Terms & Privacy ](#terms-privacy)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ License ](#license)
* [ Face Mesh Detection ](/docs/sdks/capacitor/mlkit/face-mesh-detection/)
* [ GenAI Image Description ](/docs/sdks/capacitor/mlkit/genai-image-description/)
* [ GenAI Prompt ](/docs/sdks/capacitor/mlkit/genai-prompt/)
* [ GenAI Proofreading ](/docs/sdks/capacitor/mlkit/genai-proofreading/)
* [ GenAI Rewriting ](/docs/sdks/capacitor/mlkit/genai-rewriting/)
* [ GenAI Speech Recognition ](/docs/sdks/capacitor/mlkit/genai-speech-recognition/)
* [ GenAI Summarization ](/docs/sdks/capacitor/mlkit/genai-summarization/)
* [ Image Labeling ](/docs/sdks/capacitor/mlkit/image-labeling/)
* [ Language Identification ](/docs/sdks/capacitor/mlkit/language-identification/)
* [ Object Detection ](/docs/sdks/capacitor/mlkit/object-detection/)
* [ Pose Detection ](/docs/sdks/capacitor/mlkit/pose-detection/)
* [ Selfie Segmentation ](/docs/sdks/capacitor/mlkit/selfie-segmentation/)
* [ Smart Reply ](/docs/sdks/capacitor/mlkit/smart-reply/)
* [ Subject Segmentation ](/docs/sdks/capacitor/mlkit/subject-segmentation/)
* [ Text Recognition ](/docs/sdks/capacitor/mlkit/text-recognition/)
* [ Translation ](/docs/sdks/capacitor/mlkit/translation/)
* [ Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [ Network ](/docs/sdks/capacitor/network/)
* [ NFC ](/docs/sdks/capacitor/nfc/)
* [ Node.js ](/docs/sdks/capacitor/nodejs/)
* [ OAuth ](/docs/sdks/capacitor/oauth/)
* [ Passkeys ](/docs/sdks/capacitor/passkeys/)
* [ Password Autofill ](/docs/sdks/capacitor/password-autofill/)
* [ PDF Generator ](/docs/sdks/capacitor/pdf-generator/)
* [ PDF Viewer ](/docs/sdks/capacitor/pdf-viewer/)
* [ Pedometer ](/docs/sdks/capacitor/pedometer/)
* [ Permissions ](/docs/sdks/capacitor/permissions/)
* [ Phone Dialer ](/docs/sdks/capacitor/phone-dialer/)
* [ Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [ Photo Manipulator ](/docs/sdks/capacitor/photo-manipulator/)
* [ PixLive ](/docs/sdks/capacitor/pixlive/)
* [ PostHog ](/docs/sdks/capacitor/posthog/)
* [ Printer ](/docs/sdks/capacitor/printer/)
* [ Privacy Screen ](/docs/sdks/capacitor/privacy-screen/)
* [ Proximity Sensor ](/docs/sdks/capacitor/proximity-sensor/)
* [ Purchases ](/docs/sdks/capacitor/purchases/)
* [ RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [ Root Detection ](/docs/sdks/capacitor/root-detection/)
* [ Screen Brightness ](/docs/sdks/capacitor/screen-brightness/)
* [ Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [ Screen Reader ](/docs/sdks/capacitor/screen-reader/)
* [ Screenshot ](/docs/sdks/capacitor/screenshot/)
* [ Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [ Settings Launcher ](/docs/sdks/capacitor/settings-launcher/)
* [ Shake ](/docs/sdks/capacitor/shake/)
* [ Silent Mode ](/docs/sdks/capacitor/silent-mode/)
* [ SIM ](/docs/sdks/capacitor/sim/)
* [ SMS Composer ](/docs/sdks/capacitor/sms-composer/)
* [ Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [ Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [ Share Target ](/docs/sdks/capacitor/share-target/)
* [ Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [ SQLite ](/docs/sdks/capacitor/sqlite/)
* [ Superwall ](/docs/sdks/capacitor/superwall/)
* [ System WebView ](/docs/sdks/capacitor/system-webview/)
* [ Tauri ](/docs/sdks/capacitor/tauri/)
* [ Text Interaction ](/docs/sdks/capacitor/text-interaction/)
* [ Text Zoom ](/docs/sdks/capacitor/text-zoom/)
* [ Thermal State ](/docs/sdks/capacitor/thermal-state/)
* [ Toast ](/docs/sdks/capacitor/toast/)
* [ Torch ](/docs/sdks/capacitor/torch/)
* [ Vault ](/docs/sdks/capacitor/vault/)
* [ Volume ](/docs/sdks/capacitor/volume/)
* [ Wallet ](/docs/sdks/capacitor/wallet/)
* [ Wifi ](/docs/sdks/capacitor/wifi/)
* [ YouTube Player ](/docs/sdks/capacitor/youtube-player/)
* [ Zip ](/docs/sdks/capacitor/zip/)
* [ Cordova ](/docs/sdks/cordova/)
* [ Cloud ](/docs/cloud/)
* [ Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [ Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [ FAQ ](/docs/cloud/live-updates/faq/)
* [ Native Builds ](/docs/cloud/native-builds/)
* [ Set Up Environments ](/docs/cloud/native-builds/environments/)
* [ Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [ Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [ Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [ Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [ Use pnpm, Yarn, or bun ](/docs/cloud/native-builds/package-managers/)
* [ Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [ Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [ Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [ Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [ Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [ Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [ Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [ FAQ ](/docs/cloud/native-builds/faq/)
* [ App Store Publishing ](/docs/cloud/app-store-publishing/)
* [ Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [ Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [ Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [ FAQ ](/docs/cloud/app-store-publishing/faq/)
* [ Automations ](/docs/cloud/automations/)
* [ Reference ](/docs/cloud/automations/reference/)
* [ Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [ FAQ ](/docs/cloud/automations/faq/)
* [ Assist ](/docs/cloud/assist/)
* [ CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [ Webhooks ](/docs/cloud/webhooks/)
* [ Integrations ](/docs/cloud/integrations/)
* Account
* [ Organization ](/docs/cloud/organizations/)
* [ Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [ Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [ Billing ](/docs/cloud/organizations/billing/)
* [ License Keys ](/docs/cloud/license-keys/)
* [ AI ](/docs/ai/)
* [ Insiders ](/docs/insiders/)
* [ Billing & Plans ](/docs/insiders/billing-and-plans/)
* [ FAQ ](/docs/insiders/faq/)
* [ License ](https://capawesome.io/legal/eula/)
* [ Support ](/docs/support/)
* [ Contributing ](/docs/contributing/)
* Contributing code
* [ Code of Conduct ](/docs/contributing/code-of-conduct/)
* [ Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [ Blog ](/blog/)
* Categories

* [ iOS ](#ios)
* [ Configuration ](#configuration)
* [ Demo ](#demo)
* [ Usage ](#usage)
* [ API ](#api)
* [ Enums ](#enums)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Terms & Privacy ](#terms-privacy)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ License ](#license)

# Capacitor ML Kit Face Detection Plugin[¶](#capacitor-ml-kit-face-detection-plugin "Permanent link")

Unofficial Capacitor plugin for [ML Kit Face Detection](https://developers.google.com/ml-kit/vision/face-detection).[1](#fn:1)

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Use Cases[¶](#use-cases "Permanent link")

The Face Detection plugin is typically used whenever an app needs to locate faces in an image, for example:

* **Photo organization**: Detect which photos contain faces and where they are located, for example to crop thumbnails around them.
* **Selfie effects**: Use the detected face landmarks and contours to position stickers or other virtual elements on faces.
* **Smile detection**: Use the classification results to determine the probability that a person is smiling or has their eyes open.
* **Face tracking**: Maintain a consistent ID for each face across consecutive frames using the tracking option.

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 8.x.x          | \>=8.x.x          | Active support |
| 7.x.x          | 7.x.x             | Deprecated     |
| 6.x.x          | 6.x.x             | Deprecated     |

## Installation[¶](#installation "Permanent link")

You can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-0-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-1-1)Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capacitor-mlkit/face-detection` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-2-1)npm install @capacitor-mlkit/face-detection
[](#%5F%5Fcodelineno-2-2)npx cap sync
`

**Attention**: This plugin **only supports CocoaPods** for iOS dependency management. Swift Package Manager (SPM) is not supported for the ML Kit SDK, see [this comment](https://github.com/googlesamples/mlkit/issues/180#issuecomment-1298964099).

### Android[¶](#android "Permanent link")

#### Dependencies[¶](#dependencies "Permanent link")

You need to add the following meta data **in** the `application` tag in your `AndroidManifest.xml`:

`[](#%5F%5Fcodelineno-3-1)<meta-data android:name="com.google.mlkit.vision.DEPENDENCIES" android:value="face"/>
[](#%5F%5Fcodelineno-3-2)<!-- To use multiple models: android:value="face,model2,model3" -->
`

#### Variables[¶](#variables "Permanent link")

If needed, you can define the following project variable in your app’s `variables.gradle` file to change the default version of the dependency:

* `$mlkitFaceDetectionVersion` version of `com.google.mlkit:face-detection` (default: `16.1.7`)
* `$playServicesMlkitFaceDetectionVersion` version of `com.google.android.gms:play-services-mlkit-face-detection` (default: `17.1.0`)

This can be useful if you encounter dependency conflicts with other plugins in your project.

### iOS[¶](#ios "Permanent link")

#### Minimum Deployment Target[¶](#minimum-deployment-target "Permanent link")

Make sure to set the deployment target in your `ios/App/Podfile` to at least `15.5`:

`[](#%5F%5Fcodelineno-4-1)platform :ios, '15.5'
`

## Configuration[¶](#configuration "Permanent link")

No configuration required for this plugin.

## Demo[¶](#demo "Permanent link")

A working example can be found here: [robingenz/capacitor-mlkit-plugin-demo](https://github.com/robingenz/capacitor-mlkit-plugin-demo)

## Usage[¶](#usage "Permanent link")

The following example shows how to detect faces in an image.

### Detect faces in an image[¶](#detect-faces-in-an-image "Permanent link")

Detect human faces in an image at a local path. You can configure the accuracy/speed trade-off and enable landmarks, contours, classification (smiling and eyes open probabilities), and face tracking. Only available on Android and iOS:

`[](#%5F%5Fcodelineno-5-1)import {
[](#%5F%5Fcodelineno-5-2)  FaceDetection,
[](#%5F%5Fcodelineno-5-3)  PerformanceMode,
[](#%5F%5Fcodelineno-5-4)  LandmarkMode,
[](#%5F%5Fcodelineno-5-5)  ContourMode,
[](#%5F%5Fcodelineno-5-6)  ClassificationMode,
[](#%5F%5Fcodelineno-5-7)} from '@capacitor-mlkit/face-detection';
[](#%5F%5Fcodelineno-5-8)
[](#%5F%5Fcodelineno-5-9)const processImage = async () => {
[](#%5F%5Fcodelineno-5-10)  const { faces } = await FaceDetection.processImage({
[](#%5F%5Fcodelineno-5-11)    path: 'path/to/image.jpg',
[](#%5F%5Fcodelineno-5-12)    performanceMode: PerformanceMode.Fast,
[](#%5F%5Fcodelineno-5-13)    landmarkMode: LandmarkMode.All,
[](#%5F%5Fcodelineno-5-14)    contourMode: ContourMode.All,
[](#%5F%5Fcodelineno-5-15)    classificationMode: ClassificationMode.All,
[](#%5F%5Fcodelineno-5-16)    minFaceSize: 0.1,
[](#%5F%5Fcodelineno-5-17)    enableTracking: false,
[](#%5F%5Fcodelineno-5-18)  });
[](#%5F%5Fcodelineno-5-19)  return faces;
[](#%5F%5Fcodelineno-5-20)};
`

## API[¶](#api "Permanent link")

* [processImage(...)](#processimage)
* [Interfaces](#interfaces)
* [Enums](#enums)

### processImage(...)[¶](#processimage "Permanent link")

`[](#%5F%5Fcodelineno-6-1)processImage(options: ProcessImageOptions) => Promise<ProcessImageResult>
`

Detects human faces from the supplied image.

Only available on Android and iOS.

| Param       | Type                                        |
| ----------- | ------------------------------------------- |
| **options** | [ProcessImageOptions](#processimageoptions) |

**Returns:** `Promise<[ProcessImageResult](#processimageresult)>`

**Since:** 5.1.0

---

### Interfaces[¶](#interfaces "Permanent link")

#### ProcessImageResult[¶](#processimageresult "Permanent link")

| Prop      | Type     | Description         | Since |
| --------- | -------- | ------------------- | ----- |
| **faces** | Face\[\] | The detected faces. | 5.1.0 |

#### Face[¶](#face "Permanent link")

Represents a face detected by `FaceDetector`.

| Prop                        | Type             | Description                                                                                                                                                                | Since |
| --------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **bounds**                  | [Rect](#rect)    | Returns the axis-aligned bounding rectangle of the detected face.                                                                                                          | 5.1.0 |
| **landmarks**               | FaceLandmark\[\] | Returns a list of face landmarks.                                                                                                                                          | 5.1.0 |
| **contours**                | FaceContour\[\]  | Returns a list of face contours.                                                                                                                                           | 5.1.0 |
| **trackingId**              | number           | Returns the tracking ID if the tracking is enabled.                                                                                                                        | 5.1.0 |
| **headEulerAngleX**         | number           | Returns the rotation of the face about the horizontal axis of the image. Positive euler X is the face is looking up.                                                       | 5.1.0 |
| **headEulerAngleY**         | number           | Returns the rotation of the face about the vertical axis of the image. Positive euler y is when the face turns toward the right side of the image that is being processed. | 5.1.0 |
| **headEulerAngleZ**         | number           | Returns the rotation of the face about the axis pointing out of the image. Positive euler z is a counter-clockwise rotation within the image plane.                        | 5.1.0 |
| **smilingProbability**      | number           | Returns a value between 0.0 and 1.0 giving a probability that the face is smiling.                                                                                         | 5.1.0 |
| **leftEyeOpenProbability**  | number           | Returns a value between 0.0 and 1.0 giving a probability that the face's left eye is open.                                                                                 | 5.1.0 |
| **rightEyeOpenProbability** | number           | Returns a value between 0.0 and 1.0 giving a probability that the face's right eye is open.                                                                                | 5.1.0 |

#### Rect[¶](#rect "Permanent link")

[Rect](#rect) holds four integer coordinates for a rectangle.

| Prop       | Type   | Description                                          | Since |
| ---------- | ------ | ---------------------------------------------------- | ----- |
| **left**   | number | The X coordinate of the left side of the rectangle.  | 5.1.0 |
| **top**    | number | The Y coordinate of the top of the rectangle.        | 5.1.0 |
| **right**  | number | The X coordinate of the right side of the rectangle. | 5.1.0 |
| **bottom** | number | The Y coordinate of the bottom of the rectangle.     | 5.1.0 |

#### FaceLandmark[¶](#facelandmark "Permanent link")

Represent a face landmark. A landmark is a point on a detected face, such as an eye, nose, or mouth.

| Prop         | Type                          | Description                                                                                | Since |
| ------------ | ----------------------------- | ------------------------------------------------------------------------------------------ | ----- |
| **type**     | [LandmarkType](#landmarktype) | Gets the [FaceLandmark](#facelandmark).[LandmarkType](#landmarktype) type.                 | 5.1.0 |
| **position** | [Point](#point)               | Gets a 2D point for landmark position, where (0, 0) is the upper-left corner of the image. | 5.1.0 |

#### Point[¶](#point "Permanent link")

[Point](#point) holds two coordinates

| Prop  | Type   |
| ----- | ------ |
| **x** | number |
| **y** | number |

#### FaceContour[¶](#facecontour "Permanent link")

Represent a face contour. A contour is a list of points on a detected face, such as the mouth.

| Prop       | Type                        | Description                                                                                         | Since |
| ---------- | --------------------------- | --------------------------------------------------------------------------------------------------- | ----- |
| **type**   | [ContourType](#contourtype) | Gets the [FaceContour](#facecontour).[ContourType](#contourtype) type.                              | 5.1.0 |
| **points** | Point\[\]                   | Gets a list of 2D points for this face contour, where (0, 0) is the upper-left corner of the image. | 5.1.0 |

#### ProcessImageOptions[¶](#processimageoptions "Permanent link")

| Prop                   | Type                                      | Description                                                                                                                                                                                     | Default                 | Since |
| ---------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ----- |
| **path**               | string                                    | The local path to the image file.                                                                                                                                                               |                         | 5.1.0 |
| **performanceMode**    | [PerformanceMode](#performancemode)       | Defines options to control accuracy / speed trade-offs in performing face detection.                                                                                                            | PerformanceMode.Fast    | 5.1.0 |
| **landmarkMode**       | [LandmarkMode](#landmarkmode)             | Defines options to enable face landmarks or not.                                                                                                                                                | LandmarkMode.None       | 5.1.0 |
| **contourMode**        | [ContourMode](#contourmode)               | Defines options to enable face contours or not.                                                                                                                                                 | ContourMode.None        | 5.1.0 |
| **classificationMode** | [ClassificationMode](#classificationmode) | Defines options for characterizing attributes such as "smiling" \* and "eyes open".                                                                                                             | ClassificationMode.None | 5.1.0 |
| **minFaceSize**        | number                                    | Sets the smallest desired face size, expressed as a proportion of the width of the head to the image width.                                                                                     | 0.1                     | 5.1.0 |
| **enableTracking**     | boolean                                   | Enables face tracking, which will maintain a consistent ID for each face when processing consecutive frames. Tracking should be disabled for handling a series of non-consecutive still images. | false                   | 5.1.0 |

### Enums[¶](#enums "Permanent link")

#### LandmarkType[¶](#landmarktype "Permanent link")

| Members         | Value | Description                                                                                                                                                                                                            | Since |
| --------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **MouthBottom** | 0     | The center of the subject's bottom lip.                                                                                                                                                                                | 5.1.0 |
| **LeftCheek**   | 1     | The midpoint between the subject's left mouth corner and the outer corner of the subject's left eye. For full profile faces, this becomes the centroid of the nose base, nose tip, left ear lobe and left ear tip.     | 5.1.0 |
| **LeftEar**     | 3     | The midpoint of the subject's left ear tip and left ear lobe.                                                                                                                                                          | 5.1.0 |
| **LeftEye**     | 4     | The center of the subject's left eye cavity.                                                                                                                                                                           | 5.1.0 |
| **MouthLeft**   | 5     | The subject's left mouth corner where the lips meet.                                                                                                                                                                   | 5.1.0 |
| **NoseBase**    | 6     | The midpoint between the subject's nostrils where the nose meets the face.                                                                                                                                             | 5.1.0 |
| **RightCheek**  | 7     | The midpoint between the subject's right mouth corner and the outer corner of the subject's right eye. For full profile faces, this becomes the centroid of the nose base, nose tip, right ear lobe and right ear tip. | 5.1.0 |
| **RightEar**    | 9     | The midpoint of the subject's right ear tip and right ear lobe.                                                                                                                                                        | 5.1.0 |
| **RightEye**    | 10    | The center of the subject's right eye cavity.                                                                                                                                                                          | 5.1.0 |
| **MouthRight**  | 11    | The subject's right mouth corner where the lips meet.                                                                                                                                                                  | 5.1.0 |

#### ContourType[¶](#contourtype "Permanent link")

| Members                | Value | Description                                        | Since |
| ---------------------- | ----- | -------------------------------------------------- | ----- |
| **Face**               | 1     | The outline of the subject's face.                 | 5.1.0 |
| **LeftEyebrowTop**     | 2     | The top outline of the subject's left eyebrow.     | 5.1.0 |
| **LeftEyebrowBottom**  | 3     | The bottom outline of the subject's left eyebrow.  | 5.1.0 |
| **RightEyebrowTop**    | 4     | The top outline of the subject's right eyebrow.    | 5.1.0 |
| **RightEyebrowBottom** | 5     | The bottom outline of the subject's right eyebrow. | 5.1.0 |
| **LeftEye**            | 6     | The outline of the subject's left eye cavity.      | 5.1.0 |
| **RightEye**           | 7     | The outline of the subject's right eye cavity.     | 5.1.0 |
| **UpperLipTop**        | 8     | The top outline of the subject's upper lip.        | 5.1.0 |
| **UpperLipBottom**     | 9     | The bottom outline of the subject's upper lip.     | 5.1.0 |
| **LowerLipTop**        | 10    | The top outline of the subject's lower lip.        | 5.1.0 |
| **LowerLipBottom**     | 11    | The bottom outline of the subject's lower lip.     | 5.1.0 |
| **NoseBridge**         | 12    | The outline of the subject's nose bridge.          | 5.1.0 |
| **NoseBottom**         | 13    | The outline of the subject's nose bridge.          | 5.1.0 |
| **LeftCheek**          | 14    | The center of the left cheek.                      | 5.1.0 |
| **RightCheek**         | 15    | The center of the right cheek.                     | 5.1.0 |

#### PerformanceMode[¶](#performancemode "Permanent link")

| Members      | Value | Description                                                                                                                                                                                                                 | Since |
| ------------ | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **Fast**     | 1     | Indicates a preference for speed in the options that may make an accuracy vs. speed trade-off. This will tend to detect fewer faces and may be less precise in determining values such as position, but will run faster.    | 5.1.0 |
| **Accurate** | 2     | Indicates a preference for accuracy in the options that may make an accuracy vs. speed trade-off. This will tend to detect more faces and may be more precise in determining values such as position, at the cost of speed. | 5.1.0 |

#### LandmarkMode[¶](#landmarkmode "Permanent link")

| Members  | Value | Description                                             | Since |
| -------- | ----- | ------------------------------------------------------- | ----- |
| **None** | 1     | Does not perform landmark detection.                    | 5.1.0 |
| **All**  | 2     | Detects [FaceLandmark](#facelandmark) for a given face. | 5.1.0 |

#### ContourMode[¶](#contourmode "Permanent link")

| Members  | Value | Description                                                                                                | Since |
| -------- | ----- | ---------------------------------------------------------------------------------------------------------- | ----- |
| **None** | 1     | Does not perform contour detection.                                                                        | 5.1.0 |
| **All**  | 2     | Detects [FaceContour](#facecontour) for a given face. Note that it would return contours for up to 5 faces | 5.1.0 |

#### ClassificationMode[¶](#classificationmode "Permanent link")

| Members  | Value | Description                                        | Since |
| -------- | ----- | -------------------------------------------------- | ----- |
| **None** | 1     | Does not perform classification.                   | 5.1.0 |
| **All**  | 2     | Performs "eyes open" and "smiling" classification. | 5.1.0 |

## FAQ[¶](#faq "Permanent link")

### Which platforms are supported by this plugin?[¶](#which-platforms-are-supported-by-this-plugin "Permanent link")

The `processImage(...)` method is only available on Android and iOS. The Web platform is not supported by the underlying ML Kit Face Detection SDK.

### Does the plugin recognize who is in the picture?[¶](#does-the-plugin-recognize-who-is-in-the-picture "Permanent link")

No, the plugin performs face detection, not face recognition. It detects the position of faces in an image along with attributes such as landmarks, contours, head rotation, and smiling probability, but it does not identify individuals. With the `enableTracking` option you can only maintain a consistent ID for the same face across consecutive frames.

### What is the difference between landmarks and contours?[¶](#what-is-the-difference-between-landmarks-and-contours "Permanent link")

A landmark is a single point on a detected face, such as an eye, nose, or mouth. A contour is a list of points that outlines a facial feature, such as the face oval, eyebrows, eyes, or lips. Landmarks are enabled via the `landmarkMode` option and contours via the `contourMode` option. Note that contours are only returned for up to 5 faces.

### How can I detect whether a person is smiling or has their eyes open?[¶](#how-can-i-detect-whether-a-person-is-smiling-or-has-their-eyes-open "Permanent link")

Set the `classificationMode` option to `All`. The detected faces then contain the `smilingProbability`, `leftEyeOpenProbability`, and `rightEyeOpenProbability` properties, each a value between 0.0 and 1.0.

### What is the difference between this plugin and the Face Mesh Detection plugin?[¶](#what-is-the-difference-between-this-plugin-and-the-face-mesh-detection-plugin "Permanent link")

This plugin detects faces with bounding boxes, landmarks, contours, and classifications on Android and iOS. The [ML Kit Face Mesh Detection](https://capawesome.io/docs/sdks/capacitor/mlkit/face-mesh-detection/) plugin returns a dense mesh of 468 3D points and triangle information for detected faces, but is only available on Android.

### Can I use this plugin with Ionic, React, Vue or Angular?[¶](#can-i-use-this-plugin-with-ionic-react-vue-or-angular "Permanent link")

Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.

## Related Plugins[¶](#related-plugins "Permanent link")

* [ML Kit Face Mesh Detection](https://capawesome.io/docs/sdks/capacitor/mlkit/face-mesh-detection/): Detect face meshes with 468 3D points in images.
* [ML Kit Selfie Segmentation](https://capawesome.io/docs/sdks/capacitor/mlkit/selfie-segmentation/): Segment selfies from the background with ML Kit Selfie Segmentation.
* [ML Kit Subject Segmentation](https://capawesome.io/docs/sdks/capacitor/mlkit/subject-segmentation/): Separate subjects from the background with ML Kit Subject Segmentation.
* [ML Kit Pose Detection](https://capawesome.io/docs/sdks/capacitor/mlkit/pose-detection/): Detect body poses alongside faces in the same scene.

## Terms & Privacy[¶](#terms-privacy "Permanent link")

This plugin uses the [Google ML Kit](https://developers.google.com/ml-kit):

* [Terms & Privacy](https://developers.google.com/ml-kit/terms)
* [Android Data Disclosure](https://developers.google.com/ml-kit/android-data-disclosure)
* [iOS Data Disclosure](https://developers.google.com/ml-kit/ios-data-disclosure)

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-mlkit/blob/main/packages/face-detection/CHANGELOG.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-mlkit/blob/main/packages/face-detection/LICENSE).

---

1. This project is not affiliated with, endorsed by, sponsored by, or approved by Google LLC or any of their affiliates or subsidiaries. [↩](#fnref:1 "Jump back to footnote 1 in the text")

July 8, 2026 

Back to top

```json
{"@context": "https://schema.org", "@graph": [{"@type": "TechArticle", "@id": "https://capawesome.io/docs/sdks/capacitor/mlkit/face-detection/#article", "headline": "Capacitor ML Kit Face Detection Plugin for Android & iOS", "name": "Capacitor ML Kit Face Detection Plugin for Android & iOS", "description": "Unofficial Capacitor plugin for Google ML Kit Face Detection SDK to detect faces in images with support for Android and iOS.", "inLanguage": "en", "url": "https://capawesome.io/docs/sdks/capacitor/mlkit/face-detection/", "mainEntityOfPage": "https://capawesome.io/docs/sdks/capacitor/mlkit/face-detection/", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "about": {"@id": "https://capawesome.io/docs/sdks/capacitor/mlkit/face-detection/#software"}}, {"@type": "SoftwareSourceCode", "@id": "https://capawesome.io/docs/sdks/capacitor/mlkit/face-detection/#software", "name": "Capacitor ML Kit Face Detection Plugin for Android & iOS", "description": "Unofficial Capacitor plugin for Google ML Kit Face Detection SDK to detect faces in images with support for Android and iOS.", "url": "https://capawesome.io/docs/sdks/capacitor/mlkit/face-detection/", "programmingLanguage": "TypeScript", "runtimePlatform": "Capacitor", "codeRepository": "https://github.com/capawesome-team", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}}]}
{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "Which platforms are supported by this plugin?", "acceptedAnswer": {"@type": "Answer", "text": "The processImage(...) method is only available on Android and iOS. The Web platform is not supported by the underlying ML Kit Face Detection SDK."}}, {"@type": "Question", "name": "Does the plugin recognize who is in the picture?", "acceptedAnswer": {"@type": "Answer", "text": "No, the plugin performs face detection, not face recognition. It detects the position of faces in an image along with attributes such as landmarks, contours, head rotation, and smiling probability, but it does not identify individuals. With the enableTracking option you can only maintain a consistent ID for the same face across consecutive frames."}}, {"@type": "Question", "name": "What is the difference between landmarks and contours?", "acceptedAnswer": {"@type": "Answer", "text": "A landmark is a single point on a detected face, such as an eye, nose, or mouth. A contour is a list of points that outlines a facial feature, such as the face oval, eyebrows, eyes, or lips. Landmarks are enabled via the landmarkMode option and contours via the contourMode option. Note that contours are only returned for up to 5 faces."}}, {"@type": "Question", "name": "How can I detect whether a person is smiling or has their eyes open?", "acceptedAnswer": {"@type": "Answer", "text": "Set the classificationMode option to All. The detected faces then contain the smilingProbability, leftEyeOpenProbability, and rightEyeOpenProbability properties, each a value between 0.0 and 1.0."}}, {"@type": "Question", "name": "What is the difference between this plugin and the Face Mesh Detection plugin?", "acceptedAnswer": {"@type": "Answer", "text": "This plugin detects faces with bounding boxes, landmarks, contours, and classifications on Android and iOS. The ML Kit Face Mesh Detection plugin returns a dense mesh of 468 3D points and triangle information for detected faces, but is only available on Android."}}, {"@type": "Question", "name": "Can I use this plugin with Ionic, React, Vue or Angular?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects."}}], "url": "https://capawesome.io/docs/sdks/capacitor/mlkit/face-detection/"}
```
