Detect
顔検出API
画像内の顔を検出し、顔の位置情報を返します。オプションでランドマークと属性を返します。
Http Method
- POST
リクエストURL
- https://api3.aize.jp/face-v1.0/detect[?return_face_landmarks=true][&return_face_attributes=gender,age,emotion]
リクエストパラメータ
項目 | 型 | デフォルト値 | 説明 |
---|---|---|---|
return_face_landmarks (option) | boolean | false | 顔のランドマークを返す。 |
return_face_attributes (option) | string | empty | 性別、年齢、感情を返す場合はカンマ区切りで設定する。 |
リクエストヘッダー
項目 | 型 | 値 |
---|---|---|
Content-Type | string | application/octet-stream |
x-api-key | string | API Key |
リクエストボディ
- 画像のバイナリデータ
Response 200 レスポンス例
[
{
"face_detect_id": "fea8f988-0ba8-4962-9a5f-fd7db263ec42",
"gender": "female",
"age": 36,
"emotion": {
"disgust": 0.000029264454497024,
"surprise": 0.000010694823686208,
"anger": 0.000042628853407223,
"happiness": 0.000036440698750084,
"fear": 0.0000053929124987917,
"sadness": 0.00036230066325516,
"neutral": 0.99951326847076
},
"face_rectangle": {
"height": 136,
"width": 175,
"top": 50,
"left": 133
},
"face_landmarks": {
"pupil_left": {
"x": 195,
"y": 119
},
"nose_tip": {
"x": 233,
"y": 158
},
"pupil_right": {
"x": 251,
"y": 120
},
"mouth_right": {
"x": 246,
"y": 188
},
"mouth_left": {
"x": 203,
"y": 188
}
},
}
},
"confidence": 0.99999737739563
]
Response 200 レスポンス項目
項目 | 型 | 説明 |
---|---|---|
face_detect_id | string | 顔検出ID |
gender | string | 性別 |
age | number | 年齢 |
emotion | object |
感情 感情のリストと、特定の顔に対する検出の信頼度。 信頼度スコアは正規化され、すべての感情スコアの合計は 1 になる。 ・disgust 軽蔑 ・surprise 驚き ・anger 怒り ・happiness 喜び ・fear 恐怖 ・sadness 悲しみ ・neutral 中立 |
face_rectangle | object |
左、上、幅、高さを示すこのピクセル座標のセット。 ・left 左 ・top 上 ・width 幅 ・height 高さ |
face_landmarks | object |
瞳孔、鼻の先端など、顔の中の見つけやすいポイントのセット。位置はxとyで表現される。 ・pupil_left 左瞳孔 ・nose_tip 鼻の先端 ・pupil_right 右瞳孔 ・mouth_right 口の右端 ・mouth_left 口の左端 |
confidence | number |
顔検出の自信度。最大値1。 |
エラー レスポンス例
{
"code": "invalid_image",
"message": "Invalid image format. Supported formats include JPEG and PNG."
}
エラー レスポンス一覧
HTTPステータス | コード | メッセージ | 説明 |
---|---|---|---|
400 | invalid_image | Image is required. | 入力画像が空 |
400 | invalid_image | Invalid image format. Supported formats include JPEG and PNG. | 入力画像がJPEG、PNG以外 |
403 | invalid_api_key | Invalid api key. | APIキーが不正 |
413 | invalid_image_size | Image size is too big. The valid image file size should be no larger than 6MB. | 入力画像サイズが制限を超えている |
429 | rate_limit_exceeded | Rate limit is exceeded. | レート制限超えエラー |
429 | quota_limit_exceeded | Quota limit is exceeded. | クォータ制限超えエラー |
500 | internal_server_error | Internal server error. | 予期しないエラー |