Pangu-CV-ObjectDetection-N-2.1.0
Function
Finds all objects of interest in an image and determines their positions and categories. The Pangu CV Object Detection-N Model features a moderate 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
Image interface: POST /v1/{project_id}/infer-api/proxy/service/{deployment_id}/
For details about how to obtain the URI, see Request URI.
| 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.
| 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.
| 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 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| images | Yes | String | Definition: Base64-encoded image. Constraints:
Value range: N/A Default value: N/A |
| nms_iou_thr | Yes | Float | Definition: Non-Maximum Suppression (NMS) IoU threshold. Constraints: N/A Value range: 0.0~1.0 Default value: N/A |
| agnostic_nms | Yes | Bool | Definition: Whether to perform class-agnostic NMS. true means to perform class-agnostic NMS and false means not. Constraints: N/A Value range: true: class-agnostic NMS Default value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| result | List | Definition: Object detection result A basic objective of object detection is to find a target object of interest in an input image or video, and determine their location and category. Therefore, the detection result includes object location and category. Constraints: N/A Value range: N/A Default value: N/A |
| Parameter | Type | Description |
|---|---|---|
| RegisterMatrix | List | Definition: Image feature matrix. Default value: [[1, 0, 0], [0, 1, 0], [0, 0, 1]] Constraints: N/A Value range: N/A Default value: N/A |
| Label | String | Definition: Predicted label The predicted label in object detection refers to the classification result of the input image or video. Constraints: N/A Value range: N/A Default value: N/A |
| Score | Float | Definition: Confidence score It is used to measure the accuracy of the prediction result of a model. Constraints: N/A Value range: N/A Default value: N/A |
| Box | Dict | Definition: Information about the detected object. Constraints: The format is {"x":x1,"y":y1,"width":w,"height":h,'Angle':angle}.
Value range: N/A Default value: N/A |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code |
| error_msg | String | Error message |
Example Request
- Example image detection request
{ "nms_iou_thr":0.45, "agnostic_nms":false, "images": "/9j/4Vr2RXhpZgAASUkqAAgAAA....." }
Example Response
{
"result": [
{
"RegisterMatrix": [
[
1,
0,
0
],
[
0,
1,
0
],
[
0,
0,
1
]
]
},
{
"Box": {
"Y": 0,
"Width": 100,
"Angle": 0,
"X": 0,
"Height": 100
},
"Score": 0.9,
"label": "person"
}
]
} Status Codes
For details, see Status Codes.
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot