ガイド
タスク(認識)
AWS WAF

AWS WAF 画像認識

WARNING

createTask を使用してタスクを作成します

このインターフェースは結果を個別に取得する必要はなく、画像認識結果を直接返します!

タスクの type フィールドは以下の通りです

  • AwsWafClassification

タスクの作成

createTask を使用してタスクを作成します

タスクオブジェクトの構造

プロパティ必須説明
typeString必須AwsWafClassification
websiteURLStringオプション精度向上のためのページソースURL
imagesList[string]必須base64画像文字列、aws:grid は一度に9枚の画像をサポートし、その他のタイプは一度に1枚の画像をサポートします
questionString必須質問の完全な名称については、以下の質問リストを参照してください。

質問許可リスト

aws:toycarcity:carcity  //Place a dot at the end of the car's path 
aws:grid:bed            // Choose all the beds
aws:grid:bag
aws:grid:hat
aws:grid:chair
aws:grid:bucket
aws:grid:curtain
aws:grid:mop
aws:grid:clock
aws:grid:suitcase
aws:grid:binocular
aws:grid:cooking pot

サポートされるタイプ

サポートされる画像タイプを持つ質問は以下の通りです:

タイプサポート
/aws/toycarcity.pngはい
/aws/slider.pngいいえ
/aws/grid.pngはい

リクエスト例

POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
{
 "clientKey": "YOUR_API_KEY",
 "task": {
   "type": "AwsWafClassification",
   "websiteURL": "https://xxxx.com",
   "images": [
     "/9j/4AAQSkZJRgABAgAA..."
   ],
   "question": "aws:toycarcity:carcity"
 }
}

レスポンス例

{
 "errorId": 0,
 "status": "ready",
 "solution": {
   //carcity point
   "box": [
     116.7,
     164.1
   ],
   // grid type, objects means the image index that matches the question
   "objects": [0, 1, 3, 4, 6],
   //if question include `bifurcatedzoo`
   "distance": 500
 },
 "taskId": "cbb1c730-e569-4ba6-b5fc-e06377694aa7"
}

SDKを使用したリクエスト

#pip install --upgrade capsolver
#export CAPSOLVER_API_KEY='...'
 
import capsolver
 
capsolver.api_key = "..."
 
solution = capsolver.solve({
    "type":"AwsWafClassification",
    "question":"aws:toycarcity:carcity",
    "images" : [
         "/9j/2wCEAAoHBwgH...",
    ]
})
print(solution)