次の方法で共有


Face List Operations - Add Face List Face From Url

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

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

    • 顔の画質が高いほど、認識精度が向上します。 前面、透明、顔サイズは 200 x 200 ピクセル (目の間に 100 ピクセル) 以上の高品質な顔を検討してください。
    • 各人物のエントリには、最大 248 個の顔を保持できます。
    • JPEG、PNG、GIF (最初のフレーム)、BMP 形式がサポートされています。 許可されるイメージ ファイルのサイズは 1 KB から 6 MB です。
    • "targetFace" 四角形には 1 つの顔が含まれている必要があります。 ゼロまたは複数の顔はエラーと見なされます。 指定された "targetFace" 四角形が "Detect" から返されない場合、顔を検出して正常に追加する保証はありません。
    • 検出可能な顔サイズ (36 x 36 ~ 4096 x 4096 ピクセル)、大きな頭部姿勢、または大きなオクルージョンが原因でエラーが発生します。
    • 検出可能な顔の最小サイズは、1920x1080 ピクセル以下の画像では 36 x 36 ピクセルです。 サイズが 1920 x 1080 ピクセルを超える画像では、顔の最小サイズが比例して大きくなります。
    • さまざまな '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?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

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

targetFace
query

integer[]

"targetFace=left,top,width,height" の形式で、人に追加する対象の顔を指定する顔の四角形。

userData
query

string

顔にアタッチされたユーザー指定のデータ。 サイズ制限は 1K です。

要求本文

名前 必須 説明
url True

string

入力イメージの URL。

応答

名前 説明
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 from Url

Sample Request

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

{
  "url": "https://microsoft.com/example.jpg"
}

Sample Response

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

定義

名前 説明
AddFaceResult

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

DetectionModel

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

検出された faceId に関連付けられている '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 オブジェクト。