MediaPipe 얼굴 감지기 태스크를 사용하면 이미지 또는 동영상에서 얼굴을 감지할 수 있습니다. 이 작업을 사용하여 프레임 내에서 얼굴과 얼굴 특징을 찾을 수 있습니다. 이 태스크에서는 단일 이미지 또는 연속 이미지 스트림에서 작동하는 머신러닝 (ML) 모델을 사용합니다. 이 작업은 얼굴 위치와 함께 왼쪽 눈, 오른쪽 눈, 코 끝, 입, 왼쪽 눈 이주, 오른쪽 눈 이주 등의 얼굴 주요 지점을 출력합니다.
입력 이미지 처리 - 처리에는 이미지 회전, 크기 조절, 정규화, 색상 공간 변환이 포함됩니다.
점수 기준점: 예측 점수를 기준으로 결과를 필터링합니다.
태스크 입력
태스크 출력
얼굴 감지기는 다음 데이터 유형 중 하나의 입력을 허용합니다.
정지 이미지
디코딩된 동영상 프레임
라이브 동영상 피드
얼굴 인식기는 다음과 같은 결과를 출력합니다.
이미지 프레임에서 감지된 얼굴의 경계 상자
감지된 각 얼굴의 6개 얼굴 특징 좌표입니다.
구성 옵션
이 태스크에는 다음과 같은 구성 옵션이 있습니다.
옵션 이름
설명
값 범위
기본값
running_mode
태스크의 실행 모드를 설정합니다. 모드는 세 가지입니다.
IMAGE: 단일 이미지 입력의 모드입니다.
동영상: 동영상의 디코딩된 프레임 모드입니다.
LIVE_STREAM: 카메라와 같은 입력 데이터의 라이브 스트림 모드입니다. 이 모드에서는 결과를 비동기식으로 수신할 리스너를 설정하려면 resultListener를 호출해야 합니다.
{IMAGE, VIDEO, LIVE_STREAM}
IMAGE
min_detection_confidence
얼굴 감지가 성공으로 간주되는 최소 신뢰도 점수입니다.
Float [0,1]
0.5
min_suppression_threshold
얼굴 감지가 겹쳐 있다고 간주되는 최소 비최대 억제 기준점입니다.
Float [0,1]
0.3
result_callback
얼굴 감지기가 라이브 스트림 모드일 때 감지 결과를 비동기식으로 수신하도록 결과 리스너를 설정합니다. 실행 모드가 LIVE_STREAM로 설정된 경우에만 사용할 수 있습니다.
N/A
Not set
모델
얼굴 감지 모델은 근거리 감지 및 원거리 감지와 같은 의도된 사용 사례에 따라 다를 수 있습니다. 또한 모델은 일반적으로 성능, 정확성, 해상도, 리소스 요구사항 간에 절충점을 찾고 경우에 따라 추가 기능을 포함합니다.
이 섹션에 나열된 모델은 모바일 GPU 추론에 최적화된 경량의 정확한 얼굴 감지기인 BlazeFace의 변형입니다. BlazeFace 모델은 3D 얼굴 주요 지점 추정, 표현 분류, 얼굴 영역 세분화와 같은 애플리케이션에 적합합니다. BlazeFace는 MobileNetV1/V2와 유사한 경량의 특징 추출 네트워크를 사용합니다.
BlazeFace (근거리)
스마트폰 카메라 또는 웹캠의 셀카와 같은 이미지 내에서 단일 또는 여러 얼굴을 감지하는 경량 모델입니다. 이 모델은 근거리에서 촬영한 휴대전화 전면 카메라 이미지에 최적화되어 있습니다. 모델 아키텍처는 맞춤 인코더와 함께 단일 샷 감지기 (SSD) 컨볼루션 네트워크 기법을 사용합니다. 자세한 내용은 단일 샷 멀티박스 감지기에 관한 연구 논문을 참고하세요.
스마트폰 카메라 또는 웹캠의 이미지 내에서 단일 또는 여러 개의 얼굴을 감지하는 비교적 가벼운 모델입니다. 이 모델은 후면 휴대전화 카메라로 촬영한 이미지와 같이 전체 범위 이미지에 최적화되어 있습니다. 모델 아키텍처는 맞춤 인코더가 있는 CenterNet 컨볼루션 네트워크와 유사한 기법을 사용합니다.
모델 이름
입력 셰이프
양자화 유형
모델 카드
버전
BlazeFace (전체 범위)
128x128
부동 소수점 수 16
정보
출시 예정
BlazeFace Sparse (전체 범위)
일반 전체 범위 BlazeFace 모델의 더 가벼운 버전으로 크기가 약 60% 더 작습니다. 이 모델은 후면 휴대전화 카메라로 촬영한 이미지와 같이 전체 범위 이미지에 최적화되어 있습니다. 모델 아키텍처는 맞춤 인코더가 있는 CenterNet 컨볼루션 네트워크와 유사한 기법을 사용합니다.
모델 이름
입력 셰이프
양자화 유형
모델 카드
버전
BlazeFace Sparse (전체 범위)
128x128
부동 소수점 수 16
정보
출시 예정
작업 벤치마크
다음은 위의 사전 학습된 모델을 기반으로 한 전체 파이프라인의 태스크 벤치마크입니다. 지연 시간 결과는 CPU / GPU를 사용하는 Pixel 6의 평균 지연 시간입니다.
[[["이해하기 쉬움","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(UTC)"],[],[],null,["The MediaPipe Face Detector task lets you detect faces in an image or video. You can use\nthis task to locate faces and facial features within a frame. This task uses a\nmachine learning (ML) model that works with single images or a continuous\nstream of images. The task outputs face locations, along with the following\nfacial key points: left eye, right eye, nose tip, mouth, left eye tragion, and\nright eye tragion.\n\n[Try it!arrow_forward](https://mediapipe-studio.webapps.google.com/demo/face_detector)\n\nGet Started\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/face_detector/android) - [Guide](./android)\n- **Python** - [Code\n example](https://colab.sandbox.google.com/github/googlesamples/mediapipe/blob/main/examples/face_detector/python/face_detector.ipynb)- [Guide](./python)\n- **Web** - [Code\n example](https://codepen.io/mediapipe-preview/pen/OJByWQr) - [Guide](./web_js)\n- **iOS** - [Code\n example](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/face_detector/ios) - [Guide](./ios)\n\nTask details\n\nThis section describes the capabilities, inputs, outputs, and configuration\noptions of this task.\n\nFeatures\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 Face Detector accepts an input of one of the following data types: - Still images \u003c!-- --\u003e - Decoded video frames \u003c!-- --\u003e - Live video feed | The Face Detector outputs the following results: - Bounding boxes for detected faces in an image frame. \u003c!-- --\u003e - Coordinates for 6 face landmarks for each detected face. |\n\nConfigurations 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| `min_detection_confidence` | The minimum confidence score for the face detection to be considered successful. | `Float [0,1]` | `0.5` |\n| `min_suppression_threshold` | The minimum non-maximum-suppression threshold for face detection to be considered overlapped. | `Float [0,1]` | `0.3` |\n| `result_callback` | Sets the result listener to receive the detection results asynchronously when the Face Detector is in the live stream mode. Can only be used when running mode is set to `LIVE_STREAM`. | `N/A` | `Not set` |\n\nModels\n\nFace detection models can vary depending on their intended use cases, such as\nshort-range and long-range detection. Models also typically make trade-offs\nbetween performance, accuracy, resolution, and resource requirements, and in\nsome cases, include additional features.\n\nThe models listed in this section are variants of BlazeFace, a lightweight and\naccurate face detector optimized for mobile GPU inference. BlazeFace models are\nsuitable for applications like 3D facial keypoint estimation, expression\nclassification, and face region segmentation. BlazeFace uses a lightweight\nfeature extraction network similar to\n[MobileNetV1/V2](https://arxiv.org/abs/1704.04861).\n| **Attention:** This MediaPipe Solutions Preview is an early release. [Learn more](/edge/mediapipe/solutions/about#notice).\n\nBlazeFace (short-range)\n\nA lightweight model for detecting single or multiple faces within selfie-like\nimages from a smartphone camera or webcam. The model is optimized for\nfront-facing phone camera images at short range. The model architecture uses a\nSingle Shot Detector (SSD) convolutional network technique with a custom\nencoder. For more information, see the research paper on\n[Single Shot MultiBox Detector](https://arxiv.org/abs/1512.02325).\n\n| Model name | Input shape | Quantization type | Model Card | Versions |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|-------------------|--------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|\n| [BlazeFace (short-range)](https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/latest/blaze_face_short_range.tflite) | 128 x 128 | float 16 | [info](https://storage.googleapis.com/mediapipe-assets/MediaPipe%20BlazeFace%20Model%20Card%20(Short%20Range).pdf) | [Latest](https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/latest/blaze_face_short_range.tflite) |\n\nBlazeFace (full-range)\n\nA relatively lightweight model for detecting single or multiple faces within\nimages from a smartphone camera or webcam. The model is optimized for full-range\nimages, like those taken with a back-facing phone camera images. The model\narchitecture uses a technique similar to a\n[CenterNet](https://arxiv.org/abs/1904.08189) convolutional network with a\ncustom encoder.\n\n| Model name | Input shape | Quantization type | Model Card | Versions |\n|------------------------|-------------|-------------------|------------|-------------|\n| BlazeFace (full-range) | 128 x 128 | float 16 | info | Coming soon |\n\nBlazeFace Sparse (full-range)\n\nA lighter version of the regular full-range BlazeFace model, roughly 60% smaller\nin size. The model is optimized for full-range images, like those taken with a\nback-facing phone camera images. The model architecture uses a technique similar\nto a [CenterNet](https://arxiv.org/abs/1904.08189) convolutional network with a\ncustom encoder.\n\n| Model name | Input shape | Quantization type | Model Card | Versions |\n|-------------------------------|-------------|-------------------|------------|-------------|\n| BlazeFace Sparse (full-range) | 128 x 128 | float 16 | info | Coming soon |\n\nTask benchmarks\n\nHere's the task benchmarks for the whole pipeline based on the above\npre-trained models. The latency result is the average latency on Pixel 6 using\nCPU / GPU.\n\n| Model Name | CPU Latency | GPU Latency |\n|-------------------------|-------------|-------------|\n| BlazeFace (short-range) | 2.94ms | 7.41ms |"]]