Guide
Task(Recognition)
AWS WAF

AWS WAF Images Recognize

WARNING

Create the task with the createTask

This interface does not need to obtain the results separately, will directly return the image recognition results!

The task type field is as follows

  • AwsWafClassification

Create Task

Create the task with the createTask

Task Object Structure

PropertiesTypeRequiredDescription
typeStringRequiredAwsWafClassification
websiteURLStringOptionalPage source url to improve accuracy
imagesList[string]Requiredbase64 image string, aws:grid supports 9 images each time, other types support 1 image each time
questionStringRequiredFor full names of questions, please refer to the following list of questions.

Question allow list

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

Support Types

The questions with the supported image types are as follows:

TypesSupport
/aws/toycarcity.pngYes
/aws/slider.pngNO
/aws/grid.pngYes

Example Request

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"
 }
}

Example Response

{
 "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"
}

Use SDK Request

#pip install --upgrade capsolver
#export CAPSOLVER_API_KEY='...'
 
import capsolver
# capsolver.api_key = "..."
img_path = os.path.join(Path(__file__).resolve().parent,"queue-it.jpg")
with open(img_path,'rb') as f:
    solution = capsolver.solve({
        "type":"AwsWafClassification",
        "question":"aws:toycarcity:carcity",
        "images" : [
             "/9j/2wCEAAoHBwgH...",
        ]
    })
    print(solution)