このページは、お客様の言語ではご利用いただけません。Huawei Cloudは、より多くの言語バージョンを追加するために懸命に取り組んでいます。ご協力ありがとうございました。

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Querying a Face

Updated on 2023-04-25 GMT+08:00

Function

This API is used to query the face information in a specified facial image library.

Prerequisites:

Ensure that you have enabled FRS. For detailed operations, see Applying for FRS.

URI

GET /v2/{project_id}/face-sets/{face_set_name}/faces?offset=xxx&limit=xxx

or

GET /v2/{project_id}/face-sets/{face_set_name}/faces?face_id={face_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the ID, see Obtaining the Project ID/Account Name/AK/SK.

face_set_name

Yes

Yes

Name of a facial image library.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

offset

No. This parameter is alternative to face_id.

Integer

Start number of data records to be read. The default value is 0.

limit

No. This parameter is alternative to face_id.

Integer

Number of data records to be read. The default value is 5.

face_id

No. This parameter is alternative to offset.

String

Face ID.

NOTE:

The sum of values of offset and limit cannot exceed 10,000. The face recognition system is not a storage system and does not support data traversal. You can save the face_id and query each imported face based on the face_id.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

During API authentication using a token, the token is added to requests to obtain permissions for calling the API. The value of X-Subject-Token in the response header is the obtained token.

Content-Type

Yes

String

MIME type of the request body. The value is application/json.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

face_set_id

String

ID of the facial image library. It is a randomly generated string containing eight characters. This parameter is not included when the API fails to be called.

face_set_name

String

Name of the facial image library. This parameter is not included when the API fails to be called.

faces

Array of FaceSetFace objects

Face structure in the facial image library. For details, see FaceSetFace. This parameter is not included when the API fails to be called.

Table 5 FaceSetFace

Parameter

Type

Description

bounding_box

BoundingBox object

Position of a face in an image. For details about the BoundingBox structure, see BoundingBox.

external_fields

Object

Additional field a user customizes

external_image_id

String

ID of the external image to which a face belongs

face_id

String

Face ID, which is a unique ID generated by the system

Table 6 BoundingBox

Parameter

Type

Description

width

Integer

Width of a rectangle

top_left_y

Integer

Vertical coordinate of the upper-left corner of a rectangle

top_left_x

Integer

Horizontal coordinate of the upper-left corner of a rectangle

height

Integer

Height of a rectangle

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code when calling the API failed. This parameter is not included when the API is successfully called.

error_msg

String

Error message returned after the API fails to be called. This parameter is not included when the API is successfully called.

Example Requests

For details about how to obtain the value of X-Auth-Token, see Authentication.

  • Example request
    GET https://{endpoint}/v2/{project_id}/face-sets/showFaceSet/faces?offset=0&limit=1
    Request Header:
    Content-Type: application/json
    X-Auth-Token: MIINRwYJKoZIhvcNAQcCoIINODCCDTQCAQExDT...

Example Responses

Status code: 200

Response example (successful request)
{
  "face_set_id": "T785tx1N",
  "face_set_name": "showFaceSet",
  "faces": [
    {
      "bounding_box": {
        "width": 63,
        "top_left_y": 100,
        "top_left_x": 221,
        "height": 63
      },
      "external_image_id": "aIzRAa58",
      "face_id": "cFydu4d2",
      "external_fields": {
        "number": 122,
        "id": "home",
        "timestamp": 12
      }
    }
  ]
}

Status code: 400

Example response (failed request)
{
  "error_code": "FRS.0002",
  "error_msg": "The authentication token is abnormal."
}

Status Code

For details about the status code, see Status Codes.

Error Code

For details about the error code, see Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback