FAQ about face clustering

Updated at:

This topic describes potential issues with face clustering.

Important

This document is no longer maintained. Use the new version of Intelligent Media Management.

Why do face groups fail to be created?

To ensure the accuracy of face grouping, the following conditions must be met:

  • Add images to a media set using the IndexImage operation.

  • A media set must contain three or more images of the same person. At least three of these images must meet the following high-definition face standards:

    • The face size is larger than 50 × 50 pixels.

    • The absolute value of each of the three subkeys of the HeadPose parameter is less than 30°.

    • The value of the FaceQuality parameter is greater than 0.8.

After a group is created, images in the media set that do not meet the preceding high-definition face standards may also be clustered into the same face group.

Why can I not find a created face group?

The product uses an asynchronous indexing mechanism. Image indexing, face grouping, and making face groups searchable all take time. When you design your business logic, consider the data consistency issues that this delay causes.

  • Image indexing: The IndexImage operation typically takes 10 seconds to index an image.

  • Face grouping: The CreateGroupFacesJob operation for face clustering can take up to 180 seconds. The time required depends on the number of images indexed at a time. The operation is usually completed in a few seconds.

    Important

    The CreateGroupFacesJob operation depends on the IndexImage operation to detect faces in images. If you use MNS messages to subscribe to IndexImage results, wait for 3 seconds after the IndexImage operation is complete before you call CreateGroupFacesJob. This allows the CreateGroupFacesJob API to obtain the latest face information from the images.

  • After asynchronous API calls such as IndexImage and CreateGroupFacesJob are complete, there is a 3-second delay before you can search for the latest results using FindImages.

Should I call CreateGroupFacesJob after indexing each image?

This is not recommended. The CreateGroupFacesJob API is for incremental grouping. Typically, after a batch of images is indexed, you can call CreateGroupFacesJob once for batch clustering.

The following two solutions are recommended:

  • Simple method: For each media set, you can call the CreateGroupFacesJob API at a fixed interval, such as every 5 minutes, to perform clustering.

  • Better method: Each time you call IndexImage, push the corresponding media set to a delay queue. You can periodically retrieve the SetId from the queue to retrieve the media sets that contain new images. You can then run CreateGroupFacesJob 13 (10+3) seconds after the last IndexImage call.

Are there limits on the number of images or faces?

The number of media sets is not limited. For other limits, see Quotas.

How should I design the granularity of media sets?

A media set defines the scope for media search and face clustering. Searching and clustering across media sets are not allowed. You can partition your data based on this rule. For example, in a cloud album scenario, you can create a separate media set for each end user.

What happens if an image contains multiple people?

Face clustering groups faces by the face dimension. If an image contains multiple people, each face can be clustered into a group.

When I search by group (GroupId) using FindImages, why do the results contain other faces?

The FindImages API returns results at the image dimension. Therefore, all faces and labels within an image are returned. To find the face information for the group (person) that you searched for, traverse the Faces field in the results. Then, retrieve the face object where the GroupId matches the GroupId that you searched for. This lets you retrieve information about the corresponding face, such as its position, expression, and age.

Other questions

If you have other questions, you can provide feedback in the DingTalk group. For the DingTalk group number, see Contact us.