Image Elements Detection Submit API Reference

Image Elements Detection Submit

GET/POST /ai/image/detection/batch

The image elements detection API is an efficient asynchronous batch processing API designed specifically for the identification of specific elements in e-commerce images. It can delve into the details within images to help users quickly identify the image subject and background elements such as text, logos, watermarks, and text-containing color blocks, greatly enhancing the efficiency and accuracy of image screening.

Request Parameters

Name
Type
Required
Description

imageUrl

String

Yes

URL of the image. The image should be in JPG, JPEG, PNG, or BMP format, with a resolution between 512x512 and 3000x3000 pixels, and a file size of no more than 10MB.

objectDetectElements

number[]

No

Detect elements on the subject of the image (1=Semi-Transparent Elements; 2=Specific Name; 3=Character).

nonObjectDetectElements

number[]

No

Detect elements not on the subject of the image (1=Semi-Transparent Elements; 2=Specific Name; 3=Character). It is not allowed to be empty at the same time as objectDetectElements.

returnCharacter

Integer

No

Whether to return the OCR result of the recognized area text (1 for yes, 0 for no). Default is not to return if not specified.

returnBorderPixel

Integer

No

Whether to return the distance of the subject's edge (1 for yes, 0 for no). Default is not to return if not specified.

returnProductProp

Integer

No

Whether to return the ratio of the subject area (1 for yes, 0 for no). Default is not to return if not specified.

returnProductNum

Integer

No

Whether to return the number of subjects (1 for yes, 0 for no). Default is 0 if not specified.

Sample Request

IopClient client = new IopClient(url, appkey, appSecret);
IopRequest request = new IopRequest();
request.setApiName("/ai/image/detection/batch");
request.addApiParameter("imageDetectRequestList", "[{\"objectDetectElements\":[1,2,3,4],\"imageUrl\":\"https://qingguo-data.oss-cn-shanghai.aliyuncs.com/diffusion/temp/tt074.webp\",\"nonObjectDetectElements\":[1,2,3,4],\"requestBizId\":\"1234\"}]");
IopResponse response = client.execute(request);
System.out.println(response.getBody());
Thread.sleep(10);

Response Parameters

Name
Type
Required

resCode

Number

Response code; 200 represents a successful call, other response codes can refer to error code information.

data

Object

The structure of the returned result, which includes taskId to query the results.

requestId

String

Request ID; used to identify a unique request call.

success

Boolean

Whether it is successful; true represents success, false represents failure.

resMessage

String

Error message, such as "content has sensitive data, please try other input".

Sample Response

{
  "data": {
    "usage": 0,
    "class": "com.aidc.service.api.client.image.dto.BatchImageDetectSubmitResponse",
    "taskId": "70a63d93-9cf5-45b1-9c4e-a4141cc534a4"
  },
  "requestId": "2151f84517193038927614329efd15",
  "success": true,
  "resCode": 200,
  "resMessage": "success",
  "code": "0",
  "request_id": "212a664f17193038927672523",
  "_trace_id_": "2151f84517193038927614329efd15"
}

Errors

Error Code
Error Message
Descrption

200

success

The call was successful.

501

rate limit exceed

The current interface has reached the rate limit. Please contact us via navigation bar or email us (aidge_support@service.alibaba.com) to increase the current limit.

700

invalid input

The format of the input parameters does not meet the requirements. Detailed non-compliance information will be returned in resMessage.

801

model failed

An internal call exception occurred. Please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting.

900

tpp url error

An internal call exception occurred. Please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting.

1000

content has sensitive data, please try other input

The request contains sensitive information, which is not supported at the moment. Please try other inputs.

1001

content control failed, please retry

The risk control service failed to run. Please retry. If the error persists after retrying, contact us via navigation bar or email us (aidge_support@service.alibaba.com).

1002

content risk filter failed, please contact us

The risk control service encountered an exception. Please contact us via navigation bar or email us (aidge_support@service.alibaba.com).

Notice

By using this API, you confirm that you are a legal owner of all intellectual property rights pertaining to the data and content that you provide to us via the API, or have obtained the necessary authorizations for us to receive and use the same from you. You further agree that you will not use this product or any output thereof for any unlawful, unethical, unauthorized or harmful activities.

Last updated