Catch up on everything announced at Firebase Summit, and learn how Firebase can help you accelerate app development and run your app with confidence.
Learn More
提供意見
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
人臉檢測
plat_ios
plat_android
This page describes an old version of the Face Detection API, which was part
of ML Kit for Firebase. Development of this API has been moved to the
standalone ML Kit SDK, which you can use with or without Firebase.
Learn more .
See
Face Detection
for the latest documentation.
使用 ML Kit 的人臉檢測 API,您可以檢測圖像中的人臉、識別關鍵面部特徵並獲取檢測到的人臉的輪廓。
通過面部檢測,您可以獲得執行任務所需的信息,例如修飾自拍和肖像,或從用戶的照片生成頭像。由於 ML Kit 可以實時執行面部檢測,因此您可以在視頻聊天或響應玩家表情的遊戲等應用程序中使用它。
iOS 安卓
如果您是 Flutter 開發人員,您可能會對FlutterFire 感興趣,它包含一個用於 Firebase 的 ML Vision API 的插件。
這是用於 Firebase 的 ML Kit 的 beta 版本。此 API 可能會以向後不兼容的方式進行更改,並且不受任何 SLA 或棄用政策的約束。 關鍵能力 識別和定位面部特徵 獲取檢測到的每張臉的眼睛、耳朵、臉頰、鼻子和嘴巴的坐標。 獲取面部特徵的輪廓 獲取檢測到的人臉及其眼睛、眉毛、嘴唇和鼻子的輪廓。 識別面部表情 確定一個人是在微笑還是閉著眼睛。 跨視頻幀跟踪人臉 獲取檢測到的每個人臉的標識符。此標識符在調用中是一致的,因此您可以例如對視頻流中的特定人執行圖像處理。 實時處理視頻幀 人臉檢測在設備上執行,速度足夠快,可用於實時應用,例如視頻處理。
示例結果 示例 1
對於檢測到的每個人臉:
第 1 個,共 3 個 邊界多邊形 (884.880004882812, 149.546676635742), (1030.77197265625, 149.546676635742), (1030.77197265625, 329.660278320312), (884.20100460228) 旋轉角度 Y:-14.054030418395996,Z:-55.007488250732422 跟踪號碼 2 面部標誌 左眼 (945.869323730469, 211.867126464844) 右眼 (971.579467773438, 247.257247924805) 嘴巴底部 (907.756591796875, 259.714477539062)
... ETC。
特徵概率 微笑 0.88979166746139526 左眼睜開 0.98635888937860727 右眼睜開 0.99258323386311531
示例2(人臉輪廓檢測) 啟用面部輪廓檢測後,您還將獲得檢測到的每個面部特徵的點列表。這些點代表特徵的形狀。下圖說明了這些點如何映射到人臉(單擊圖像放大):
面部特徵輪廓 鼻樑 (505.149811, 221.201797), (506.987122, 313.285919) 左眼 (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) 上唇頂部 (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) (ETC。)
提供意見
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-01-18 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]
想進一步說明嗎?