次の方法で共有


Face List Operations - Add Face List Face

指定した面リストに最大 1,000 個の面を追加します。
複数の顔を含む画像を処理するには、入力面を targetFace 四角形を含む画像として指定できます。 追加された顔を表す persistedFaceId を返します。 イメージは保存されません。 "顔リストの顔の削除" または "顔リストの削除" が呼び出されるまで、抽出された顔機能のみがサーバーに保存されます。

persistedFaceId は、"Detect" によって生成された faceId とは異なります。

    • 顔の画質が高いほど、認識精度が向上します。 正面、透明、顔のサイズは 200 x 200 ピクセル (目の間に 100 ピクセル) 以上の高品質の顔を検討してください。
    • 各人のエントリには、最大 248 の顔を保持できます。
    • JPEG、PNG、GIF (最初のフレーム)、BMP 形式がサポートされています。 許可されるイメージ ファイルのサイズは 1 KB から 6 MB です。
    • "targetFace" 四角形には、1 つの顔が含まれている必要があります。 0 個または複数の面はエラーと見なされます。 指定された "targetFace" 四角形が "Detect" から返されない場合、顔を正常に検出して追加する保証はありません。
    • 検出可能な顔サイズ (36 x 36 ~ 4096 x 4096 ピクセル)、大きな頭部姿勢、または大きなオクルージョンが原因でエラーが発生します。
    • 検出可能な顔の最小サイズは、1920x1080 ピクセル以下の画像では 36 x 36 ピクセルです。 1920x1080 ピクセルより大きいサイズの画像では、顔の最小サイズが比例的に大きくなります。
    • さまざまな 'detectionModel' 値を指定できます。 さまざまな検出モデルを使用して比較するには、次を参照してください。 https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model
POST {endpoint}/face/{apiVersion}/facelists/{faceListId}/persistedfaces
POST {endpoint}/face/{apiVersion}/facelists/{faceListId}/persistedfaces?_overload=addFaceListFace&targetFace={targetFace}&detectionModel={detectionModel}&userData={userData}

URI パラメーター

名前 / 必須 説明
apiVersion
path True

string

API バージョン

endpoint
path True

string

uri

サポートされている Cognitive Services エンドポイント (プロトコルとホスト名(例: https://{resource-name}.cognitiveservices.azure.com)。

faceListId
path True

string

有効な文字は小文字、数字、'-' または '_' の文字で、最大長は 64 です。

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

detectionModel
query

DetectionModel

検出された faceIds に関連付けられている '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"

名前 説明
imageContent

string

分析対象の画像

応答

名前 説明
200 OK

AddFaceResult

呼び出しが成功すると、新しい persistedFaceId が返されます。

Other Status Codes

FaceErrorResponse

予期しないエラー応答。

Headers

x-ms-error-code: string

セキュリティ

Ocp-Apim-Subscription-Key

Azure AI Face サブスクリプションの秘密鍵。

Type: apiKey
In: header

AADToken

Azure Active Directory OAuth2 フロー

Type: oauth2
Flow: accessCode
Authorization URL: https://api.example.com/oauth2/authorize
Token URL: https://api.example.com/oauth2/token

Scopes

名前 説明
https://cognitiveservices.azure.com/.default

Add Face to FaceList

Sample Request

POST {endpoint}/face/v1.1-preview.1/facelists/your_face_list_id/persistedfaces?_overload=addFaceListFace&targetFace=10,10,100,100&detectionModel=detection_01&userData=your_user_data

"<your-image-bytes-here>"

Sample Response

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

定義

名前 説明
AddFaceResult

顔を追加するための応答本文。

DetectionModel

検出された faceIds に関連付けられている 'detectionModel'。 サポートされている 'detectionModel' 値には、'detection_01'、'detection_02'、'detection_03' があります。 既定値は 'detection_01' です。

FaceError

error オブジェクト。 Face Service によって返されるエラー コードとメッセージの包括的な詳細については、次のリンクを参照してください。 https://aka.ms/face-error-codes-and-messages

FaceErrorResponse

エラーの詳細を含む応答。

AddFaceResult

顔を追加するための応答本文。

名前 説明
persistedFaceId

string

追加された顔の永続化された顔 ID。これは永続化され、期限切れになりません。 "Detect" で作成され、検出呼び出し後 24 時間以内に期限切れになる faceId とは異なります。

DetectionModel

検出された faceIds に関連付けられている 'detectionModel'。 サポートされている 'detectionModel' 値には、'detection_01'、'detection_02'、'detection_03' があります。 既定値は 'detection_01' です。

名前 説明
detection_01

string

既定の検出モデル。 正面近くの顔検出にお勧めします。 非常に大きな角度 (頭部姿勢) の顔、隠れた顔、または間違った画像の向きのシナリオでは、そのような場合の顔は検出されない可能性があります。

detection_02

string

2019 年 5 月にリリースされた検出モデルで、特に小さい顔、側面、ぼやけた顔の精度が向上しました。

detection_03

string

2021 年 2 月にリリースされた検出モデルで、特に小さな顔の精度が向上しました。

FaceError

error オブジェクト。 Face Service によって返されるエラー コードとメッセージの包括的な詳細については、次のリンクを参照してください。 https://aka.ms/face-error-codes-and-messages

名前 説明
code

string

サーバー定義のエラー コードのセットの 1 つ。

message

string

エラーの人間が判読できる表現。

FaceErrorResponse

エラーの詳細を含む応答。

名前 説明
error

FaceError

error オブジェクト。