顔検出
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。

ML Kit の顔検出 API を使用すると、画像内の顔を検出し、主な顔の特徴を識別して、検出された顔の輪郭を取得できます。なお、この API は顔を検出しますが、人物を認識するわけではありません。
顔検出を使用すると、自撮り写真やポートレートの装飾、ユーザーの写真からのアバターの生成などのタスクに必要な情報を取得できます。ML Kit はリアルタイムで顔検出を実行できるため、ビデオチャットやプレーヤーの表情に反応するゲームなどのアプリで使用できます。
iOS
Android
主な機能
- 顔の特徴を認識して見つける
検出されたすべての顔の目、耳、頬、鼻、口の座標を取得します。
- 顔の特徴の輪郭を取得する
検出された顔、および目、眉、唇、鼻の輪郭を取得します。
- 顔の表情を認識
人が笑っているか、目を閉じているかを判断します。
- 動画フレームをまたいで顔を追跡する
検出された一意の顔それぞれについて識別子を取得します。この識別子は呼び出し間で一貫しているため、動画ストリーム内の特定の人物に画像を操作できます。
- 動画フレームをリアルタイムで処理
顔検出はデバイス上で実行され、動画操作などのリアルタイム アプリケーションで使用するのに十分な速度です。
検索結果の例
例 1

検出された顔ごとに、次の操作を行います。
顔 1/3 |
境界ポリゴン |
(884.880004882812, 149.546676635742)、(1030.77197265625, 149.546676635742)、
(1030.77197265625, 328.28028028282828282828282828283 |
回転の角度 |
Y: -14.054030418395996、Z: -55.007488250732422 |
トラッキング ID |
2 |
顔のランドマーク |
左目 |
(945.869323730469, 211.867126464844) |
右目 |
(971.579467773438, 247.257247924805) |
口の下 |
(907.756591796875, 259.714477539062) |
...など
|
特徴の確率 |
笑顔 |
0.88979166746139526 |
左目が開いている |
0.98635888937860727 |
右目を開く |
0.99258323386311531 |
|
例 2(顔の輪郭検出)
顔の輪郭検出を有効にすると、検出された顔の特徴のポイントのリストも表示できます。これらの点は対象物の形状を表します。次の図は、これらの点が顔にどのようにマッピングされるかを示しています。画像をクリックすると拡大されます。
顔の特徴の輪郭 |
鼻ブリッジ |
(505.149811, 221.201797)、(506.987122、313.285919) |
左目 |
(404.642029, 232.854431)、(408.52728(6.4, 4, 5, 6, 4, 5, 6, 4, 5, 20, 4, 5, 20, 4, 5, 20, 4, 3, 9, 3, 4, 3, 9, 3, 4, 5, 2, 5, 6, 3, 9, 3, 4, 3, 9, 3, 6, 3, 9, 3, 9, 3, 4, 3, 9, 3, 4, 3, 9, 3, 4, 5, 20,401 |
上唇の上部 |
(421.662048, 354.520813)、(428.103882, 5.4, 5, 20, 5, 4, 70, 5, 20, 5, 30, 349.694061, 1,000 |
(その他) |
|
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-29 UTC。
[null,null,["最終更新日 2025-08-29 UTC。"],[[["\u003cp\u003eML Kit's Face Detection API can detect faces and their features in images and videos, but it does not recognize individuals.\u003c/p\u003e\n"],["\u003cp\u003eIt can be used for tasks such as adding effects to photos, creating avatars, and building interactive applications that respond to facial expressions.\u003c/p\u003e\n"],["\u003cp\u003eThe API provides facial feature coordinates, contours, expression detection (like smiling), and face tracking across video frames.\u003c/p\u003e\n"],["\u003cp\u003eFace detection happens on the device and is fast enough for real-time applications.\u003c/p\u003e\n"]]],[],null,["With ML Kit's face detection API, you can detect faces in an image, identify\nkey facial features, and get the contours of detected faces. Note that the API\n*detects faces* , it does not *recognize people* .\n\nWith face detection, you can get the information you need to perform tasks like\nembellishing selfies and portraits, or generating avatars from a user's photo.\nBecause ML Kit can perform face detection in real time, you can use it in\napplications like video chat or games that respond to the player's expressions.\n\n[iOS](/ml-kit/vision/face-detection/ios)\n[Android](/ml-kit/vision/face-detection/android)\n\nKey capabilities\n\n- **Recognize and locate facial features** Get the coordinates of the eyes, ears, cheeks, nose, and mouth of every face detected.\n- **Get the contours of facial features** Get the contours of detected faces and their eyes, eyebrows, lips, and nose.\n- **Recognize facial expressions** Determine whether a person is smiling or has their eyes closed.\n- **Track faces across video frames** Get an identifier for each unique detected face. The identifier is consistent across invocations, so you can perform image manipulation on a particular person in a video stream.\n- **Process video frames in real time** Face detection is performed on the device, and is fast enough to be used in real-time applications, such as video manipulation.\n\nExample results\n\nExample 1\n\nFor each face detected:\n\n| Face 1 of 3 ||\n|---------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Bounding polygon** | (884.880004882812, 149.546676635742), (1030.77197265625, 149.546676635742), (1030.77197265625, 329.660278320312), (884.880004882812, 329.660278320312) |\n| **Angles of rotation** | Y: -14.054030418395996, Z: -55.007488250732422 |\n| **Tracking ID** | 2 |\n| **Facial landmarks** | |---------------------|--------------------------------------| | **Left eye** | (945.869323730469, 211.867126464844) | | **Right eye** | (971.579467773438, 247.257247924805) | | **Bottom of mouth** | (907.756591796875, 259.714477539062) | ... etc. |\n| **Feature probabilities** | |--------------------|---------------------| | **Smiling** | 0.88979166746139526 | | **Left eye open** | 0.98635888937860727 | | **Right eye open** | 0.99258323386311531 | |\n\nExample 2 (face contour detection)\n\nWhen you have face contour detection enabled, you also get a list of points\nfor each facial feature that was detected. These points represent the shape of\nthe feature. The following image illustrates how these points map to a face.\nClick the image to enlarge it:\n\n[](/static/ml-kit/vision/face-detection/images/face_contours.svg)\n\n| Facial feature contours ||\n|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Nose bridge** | (505.149811, 221.201797), (506.987122, 313.285919) |\n| **Left eye** | (404.642029, 232.854431), (408.527283, 231.366623), (413.565796, 229.427856), (421.378296, 226.967682), (432.598755, 225.434143), (442.953064, 226.089508), (453.899811, 228.594818), (461.516418, 232.650467), (465.069580, 235.600845), (462.170410, 236.316147), (456.233643, 236.891602), (446.363922, 237.966888), (435.698914, 238.149323), (424.320740, 237.235168), (416.037720, 236.012115), (409.983459, 234.870300) |\n| **Top of upper lip** | (421.662048, 354.520813), (428.103882, 349.694061), (440.847595, 348.048737), (456.549988, 346.295532), (480.526489, 346.089294), (503.375702, 349.470459), (525.624634, 347.352783), (547.371155, 349.091980), (560.082031, 351.693268), (570.226685, 354.210175), (575.305420, 359.257751) |\n| (etc.) | |"]]