All Products
Search
Document Center

Intelligent Media Management:CompareImageFaces

Last Updated:Dec 11, 2024

Compares the similarity of the largest faces in two images. The largest face refers to the largest face frame in an image after face detection.

Operation description

  • Before you call this operation, make sure that you are familiar with the billing of Intelligent Media Management (IMM).****
  • For the input image, only the face with the largest face frame in the image is used for face comparison. The face frame detection result is consistent with the responses of the DetectImageFaces operation.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
imm:CompareImageFacesnone
*Project
acs:imm:{#regionId}:{#accountId}:project/{#ProjectName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectNamestringYes

The name of the project. For more information, see CreateProject .

test-project
CredentialConfigCredentialConfigNo

If you have no special requirements, leave this parameter empty.

The configurations of authorization chains. This parameter is optional. For more information, see Use authorization chains to access resources of other entities.

SourceobjectNo

The URLs of the two images for compression.

URI1stringNo

The OSS URL of the image file.

Specify the URL in the oss://<bucket>/<object> format. <bucket> specifies the name of the OSS bucket that is in the same region as the current project. <object> specifies path of the object with the extension included.

oss://test-bucket/test-object1
URI2stringNo

The OSS URL of the image file.

Specify the URL in the oss://<bucket>/<object> format. <bucket> specifies the name of the OSS bucket that is in the same region as the current project, and <object> specifies the path of the object with the extension included.

oss://test-bucket/test-object2

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

RequestIdstring

The request ID.

F73AC982-2B9E-4ECD-AED5-F8331C5******
Similarityfloat

The face similarity. A larger value indicates a higher face similarity. Valid values: 0 to 1.

0.8848152756690983

Examples

Sample success responses

JSONformat

{
  "RequestId": "F73AC982-2B9E-4ECD-AED5-F8331C5******",
  "Similarity": 0.8848152756690983
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history