Updated on 2026-01-07 GMT+08:00

Pangu-CV-ObjectDetection-S-2.1.0

Function

Finds all objects of interest in an image and determines their positions and categories. The Pangu CV Object Detection-S Model features a small number of parameters and is suitable for environments with limited resources. It provides a fast detection speed and reasonable precision.

Service API calling method:

  • Image inference is supported.
  • Image inference services can be deployed as real-time services or edge services.

Authorization Information

An account has required permissions to call all APIs by default. To call this API as an IAM user, the IAM user must be granted the required permissions. For details, see Permissions and Supported Actions.

URI

POST /v1/{project_id}/infer-api/proxy/service/{deployment_id}/

For details about how to obtain the URI, see Request URI.

Table 1 Path parameters of the inference API

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition:

Project ID. For details about how to obtain a project ID, see Obtaining the Project ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

deployment_id

Yes

String

Definition:

Model deployment ID. For details about how to obtain the deployment ID, see Obtaining the Model Deployment ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Request Parameters

Table 2 lists the request header parameters for token-based authentication.

Table 2 Request header parameters (token-based authentication)

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition:

User token.

Used to obtain the permission required to call APIs. The token is the value of X-Subject-Token in the response header in Figure 4.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Content-Type

Yes

String

Definition:

MIME type of the body in the request.

Constraints:

N/A

Value range:

N/A

Default value:

application/json

Table 3 lists the request header parameters for API key authentication.

Table 3 Request header parameters (API key authentication)

Parameter

Mandatory

Type

Description

X-Apig-AppCode

Yes

String

Definition:

API key.

Used to obtain the permission required to call APIs. The API key is the value of X-Apig-AppCode in the response header in API key authentication.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Content-Type

Yes

String

Definition:

MIME type of the body in the request.

Constraints:

N/A

Value range:

N/A

Default value:

application/json

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

images

Yes

String

Definition:

Base64-encoded image.

Constraints:

  • It is recommended that the maximum size of the request body is 4 MB.
  • You are advised to use images in JPG, PNG, JPEG, or BMP format.
  • By default, only the RGB three-channel images are supported.

Value range:

N/A

Default value:

N/A

threshold

No

Float

Definition:

Bounding box confidence threshold.

Constraints:

N/A

Value range:

The value ranges from 0.0 to 1.0.

Default value:

0.25

Response Parameters

Status code: 200

Table 5 Parameters in the response body for a successful request

Parameter

Type

Description

result

Array of objects

Definition:

Detection result

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Score

Float

Definition:

Confidence score

Constraints:

N/A

Value range:

N/A

Default value:

N/A

label

String

Definition:

Detection type.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Box

Dict

Definition:

Information about the detected object.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 6 Box

Parameter

Type

Description

X

Int

Definition:

Horizontal coordinate of the upper left corner of a bounding box

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Y

Int

Definition:

Vertical coordinate of the upper left corner of a bounding box

Constraints:

N/A

Value range:

N/A

Default value:

N/A

width

Int

Definition:

Width of a bounding box

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Height

Int

Definition:

Height of a bounding box

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Angle

Int

Definition:

Angle of the bounding box

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

Example Request

{
  "images": "/9j/4Vr2RXhpZgAASUkqAAgAAA.....",
  "threshold": 0.3
}

Example Response

{
    "result": [
        {
            "Box": {
                "Angle": 0,
                "Height": 60,
                "Width": 106,
                "X": 852,
                "Y": 182
            },
            "Score": 0.88427734375,
            "label": "car"
        },
        {
            "Box": {
                "Angle": 0,
                "Height": 114,
                "Width": 55,
                "X": 800,
                "Y": 170
            },
            "Score": 0.70556640625,
            "label": "person"
        }
    ]
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.