共用方式為


Face List Operations - Add Large Face List Face

將臉部新增至指定的大型臉部清單,最多 1,000,000 張臉部。
若要處理包含多個臉部的影像,輸入臉部可以指定為具有 targetFace 矩形的影像。 它會傳回代表新增臉部的persistedFaceId。 不會儲存任何映像。 只有擷取的臉部功能才會儲存在伺服器上,直到呼叫「刪除大型臉部清單」或「刪除大型臉部清單」為止。

請注意,persistedFaceId 與 「Detect」 所產生的 faceId 不同。

    • 較高的臉部影像品質表示更好的辨識精確度。 請考慮高品質的臉部:正面、清晰和臉部大小為 200x200 像素(眼睛之間 100 像素)或更大。
    • 每位人員最多可以容納 248 張臉部。
    • 支援 JPEG、PNG、GIF(第一個畫面格)和 BMP 格式。 允許的映像檔大小從 1KB 到 6MB。
    • “targetFace” 矩形應該包含一個臉部。 零或多個臉部會被視為錯誤。 如果提供的 「targetFace」 矩形未從 「Detect」 傳回,則不保證可以偵測並成功新增臉部。
    • 無法偵測到的臉部大小(36x36 - 4096x4096 像素)、大型頭部姿勢或大型遮蔽會導致失敗。
    • 影像中可偵測到的臉部大小下限為 36x36 像素,不大於 1920x1080 圖元。 維度高於 1920x1080 像素的影像需要比例較大的最小臉部大小。
    • 您可以提供不同的 'detectionModel' 值。 若要使用和比較不同的偵測模型,請參閱 https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model

注意

    • 免費層訂用帳戶配額:每個大型臉部清單 1,000 張臉部。
    • S0 層訂用帳戶配額:每個大型臉部清單 1,000,000 張臉部。
POST {endpoint}/face/{apiVersion}/largefacelists/{largeFaceListId}/persistedfaces
POST {endpoint}/face/{apiVersion}/largefacelists/{largeFaceListId}/persistedfaces?_overload=addLargeFaceListFace&targetFace={targetFace}&detectionModel={detectionModel}&userData={userData}

URI 參數

名稱 位於 必要 類型 Description
apiVersion
path True

string

API 版本

endpoint
path True

string

uri

支持的認知服務端點(通訊協定和主機名,例如:https://{resource-name}.cognitiveservices.azure.com)。

largeFaceListId
path True

string

有效字元為小寫或數位或 '-' 或 '_',最大長度為 64。

Regex 模式: ^[a-z0-9-_]+$

detectionModel
query

DetectionModel

與偵測到的faceId相關聯的 'detectionModel'。 支援的 'detectionModel' 值包括 'detection_01'、'detection_02' 和 'detection_03'。 預設值為 『detection_01』。

targetFace
query

integer[]

要新增至人員的目標臉部矩形,格式為 'targetFace=left,top,width,height'。

userData
query

string

附加至臉部的使用者提供數據。 大小限制為 1K。

要求本文

Media Types: "application/octet-stream"

名稱 類型 Description
imageContent

string

要分析的影像

回應

名稱 類型 Description
200 OK

AddFaceResult

成功的呼叫會傳回新的persistedFaceId。

Other Status Codes

FaceErrorResponse

未預期的錯誤回應。

標題

x-ms-error-code: string

安全性

Ocp-Apim-Subscription-Key

Azure AI 臉部訂用帳戶的秘密密鑰。

類型: apiKey
位於: header

AADToken

Azure Active Directory OAuth2 流程

類型: oauth2
Flow: accessCode
授權 URL: https://api.example.com/oauth2/authorize
權杖 URL: https://api.example.com/oauth2/token

範圍

名稱 Description
https://cognitiveservices.azure.com/.default

範例

Add Face to LargeFaceList

範例要求

POST {endpoint}/face/v1.2-preview.1/largefacelists/your_large_face_list_id/persistedfaces?_overload=addLargeFaceListFace&targetFace=10,10,100,100&detectionModel=detection_01&userData=your_user_data

"<your-image-bytes-here>"

範例回覆

{
  "persistedFaceId": "43897a75-8d6f-42cf-885e-74832febb055"
}

定義

名稱 Description
AddFaceResult

用於新增臉部的回應本文。

DetectionModel

與偵測到的faceId相關聯的 'detectionModel'。 支援的 'detectionModel' 值包括 'detection_01'、'detection_02' 和 'detection_03'。 預設值為 『detection_01』。

FaceError

error 物件。 如需臉部服務所傳回錯誤碼和訊息的完整詳細數據,請參閱下列連結:https://aka.ms/face-error-codes-and-messages

FaceErrorResponse

包含錯誤詳細數據的回應。

AddFaceResult

用於新增臉部的回應本文。

名稱 類型 Description
persistedFaceId

string

已保存已新增臉部的臉部標識碼,該標識符會保存且不會過期。 不同於在 「偵測」中建立的 faceId,會在偵測呼叫之後的 24 小時內到期。

DetectionModel

與偵測到的faceId相關聯的 'detectionModel'。 支援的 'detectionModel' 值包括 'detection_01'、'detection_02' 和 'detection_03'。 預設值為 『detection_01』。

名稱 類型 Description
detection_01

string

默認偵測模型。 建議用於近距離正面偵測。 對於具有特殊大角度(頭部姿勢)臉部、遮蔽臉部或錯誤影像方向的案例,可能無法偵測到這類情況下的臉部。

detection_02

string

偵測模型於 2019 年 5 月發行,精確度更高,特別是在小型、側邊和模糊的臉部上。

detection_03

string

偵測模型於 2021 年 2 月發行,精確度更高,特別是在小臉上。

FaceError

error 物件。 如需臉部服務所傳回錯誤碼和訊息的完整詳細數據,請參閱下列連結:https://aka.ms/face-error-codes-and-messages

名稱 類型 Description
code

string

其中一組伺服器定義的錯誤碼。

message

string

錯誤的人類可讀取表示法。

FaceErrorResponse

包含錯誤詳細數據的回應。

名稱 類型 Description
error

FaceError

error 物件。