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

Pangu-CV-SemanticSegmentation-2.1.0

Function

The Pangu CV Semantic Segmentation Model can segment a digital image into multiple regions. It is suitable for tasks such as lane segmentation, building segmentation, and screening face status detection at a coal separation plant.

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}/v1/rs-server/predictions

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

img

Yes

String

Definition:

Base64-encoded image. The image size cannot exceed 2 KB. By default, only the RGB three-channel images are supported.

Constraints:

  • The maximum size of an image is 2 KB.
  • By default, only the RGB three-channel images are supported.

Value range:

N/A

Default value:

N/A

Response Parameters

Table 5 Response body

Parameter

Type

Description

result

Array

Definition:

Prediction result.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 6 Structure of result

Parameter

Type

Description

result

Array

Definition:

Prediction result. The prediction result is a two-dimensional array returned after the model performs semantic segmentation on each pixel of the input image. Each element in the array is an integer, indicating a predicted label of the pixel.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Example Request

{ 
     "img": "/9j/4Vr2RXhpZgAASUkqAAgAAA....." 
}

Example Response

{
  "result": [
    [
      0,
      ...
    ]
  ]
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.