Image Elements Detection

Introduction

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 Semi-Transparent Elements, Specific Name, Character, Color-Blocks with Characters, greatly enhancing the efficiency and accuracy of image screening.

Use Cases

  • Intelligent Image Screening and Optimization

Merchants and platforms can utilize the Image Elements Detection API for image screening, automatically identifying images that contain specific elements (e.g., watermarks, logos, etc.). After screening, they can further call the Image Elements Removal API to optimize these images, improving image quality and shortening the product release cycle.

  • Automated Image Processing and Efficiency Improvement

With the Image Elements Detection API, merchants and platforms can achieve automation in the image processing workflow, automatically identifying and marking image elements that require optimization. This process reduces manual intervention and enhances the efficiency of image processing.

Key Features

1. Definitions of Image Main Body, Background, Semi-Transparent Elements, Specific Name, Character, Color-Blocks with Characters:

For specifics, please refer to the examples in the erasure document (reserved text link).

  • Image Subject: The core product area within the image.

  • Image Background: The remaining part of the image excluding the product main body.

  • Character: Horizontal/Vertical/Oblique English/Chinese.

  • Specific Name: Emblem or any undesired logo.

  • Semi-Transparent Elements: Monochromatic transparent text, emblem, image, URL, etc.

  • Color-Blocks with Characters: Color blocks outside the main body that contain text.

2. Main Features of the Intelligent Recognition API:

  • Element Recognition: Capable of identifying whether the image main body and background contain elements such as Semi-Transparent Elements, Specific Name, Character, Color-Blocks with Characters.

  • Process Collaboration: Used in conjunction with the Image Elements Removal API, first identify elements to be removed through the Image Elements Detection API, then use the Image Elements Removal API for effective removal, ensuring the accuracy and efficiency of image processing.

3. Technical Advantages:

  • Asynchronous Batch Processing: As an asynchronous API, the Image Elements Detection API can handle a large number of images while maintaining a fast response, adapting to the needs of different business scales.

  • Flexibility: Users can choose the types of elements to be recognized according to their needs, including elements within the main and non-main body range, such as Semi-Transparent Elements, Specific Name, Character, Color-Blocks with Characters, to meet personalized recognition requirements.

Pricing

To use the API, you are required to choose and purchase an API resource pack from us on a subscription basis.

  • Each resource pack is valid for one calendar year upon successful purchase, and enables you to access the API up to the number of requests specified in the pack. No refunds can be provided.

  • If you need to purchase more QPS due to business requirements, please contact us via navigation bar or email us (aidge_support@service.alibaba.com).

  • Resource packs cannot be used across different products. For example, if you need to use both product text translation and image translation, you must purchase separate resource packs for each.

The prices are as follows:

Capacity
Price (USD)
Unit Price(USD)
Maximum QPS

1000 images

5

$0.005 /image

10

10,000 images

50

$0.005 /image

10

100,000 images

400

$0.004 /image

10

Quick Start

Below is an example of the process of calling the API to accurately locate image elements through the combination of recognition and intelligent erasure, and to obtain the final image result.

1. API Connection Process Description

This interface is an asynchronous interface:

  • Step 1: Call the "Image Elements Detection Submit" API to recognize elements such as text and logos in the image according to the request parameters and obtain a taskId.

  • Step 2: Call the "Image Elements Detection Query" API, enter the taskId, and obtain the recognition results.

  • Step 3: Call the "Image Elements Removal" API to obtain the results of the image erasure.

2. Image Elements Detection Submit - Sample Request

In the API parameters, you can select the specific elements (watermarks, logos, text, and text-containing color blocks) in the main and non-main body areas of the image that need to be detected.

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);

3. Image Elements Detection Submit - 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"
}

4. Image Elements Detection Query - Sample Request

IopClient client = new IopClient(url, appkey, appSecret);
IopRequest request = new IopRequest();
request.setApiName("/ai/image/detection/query");
request.addApiParameter("taskId", "70a63d93-9cf5-45b1-9c4e-a4141cc534a4");
IopResponse response = client.execute(request);
System.out.println(response.getBody());
Thread.sleep(10);

5. Image Elements Detection Query - Sample Response

{
    "data": {
        "taskResult": [
            {
                "usage": 1,
                "taskResult": {
                    "result": {
                        "code": 0,
                        "data": {
                            "noobj_character": true,
                            "noobj_npx": false,
                            "noobj_watermark": false,
                            "obj_logo": false,
                            "obj_watermark": false,
                            "noobj_logo": false,
                            "obj_character": true,
                            "obj_npx": false
                        },
                        "message": "success"
                    },
                    "usage": 1
                },
                "taskStatus": "finished",
                "requestBizId": ""
            }
        ],
        "taskStatus": "finished"
    },
    "requestId": "0b51259117319376514557374e2580",
    "success": true,
    "resCode": 200,
    "resMessage": "success",
    "code": "0",
    "request_id": "2151fa1917319376516431433",
    "_trace_id_": "0b51259117319376514557374e2580"
}

FAQ

  1. How should the Image Elements Detection API be used?

Generally, the Image Elements Detection API and the Image Elements Removal API are used together, that is, first automatically filter the images that meet the requirements, and then use the Image Elements Removal API for erasure.

  1. What is the response time of the Image Elements Detection API?

The Image Elements Detection API is an asynchronous batch processing API. The specific response time depends on the complexity of the task and the system load, but it is usually fast.

  1. What should I do if the number of images I need to process exceeds the limit of the resource package?

If your business requirements exceed the processing capacity of the current resource package, you can purchase a larger resource package or contact customer service for assistance.

Last updated