The facial recognition feature uses AI to identify the bounding box and facial attributes of faces in images. If there are multiple faces present within an image, the bounding box and facial attributes of each face are recognized. This metadata can be used for age and gender statistics.

Note To use the face recognition feature, you must activate Intelligent Media Management (IMM) and bind IMM to OSS. For more information, see Quick start.

The bounding box of a face contains four values: the y coordinate of the upper-left corner, the x coordinate of the upper-left corner, the width, and the height.

Facial attributes are made up of six values: gender, age, head posture, eye, facial blurring, and facial quality.


Operation: imm/detecface

Sample responses:


Assume that the requested bucket is named imm-demo and is located in the China (Hangzhou) region, the endpoint used to access the bucket is, and the requested image is named person.jpg. The unsigned URL of requested image is as follows:
The following code provides an example on how to perform the face recognition operation by using the OSS SDK for Python:
# Create a bucket. All object-related methods must be called through buckets.
bucket = oss2.Bucket(oss2.Auth(access_key_id, access_key_secret), endpoint, bucket_name)

# Detect faces.
style = 'imm/detectface'
result = bucket.get_object(objectKey, process=style)
# Obtain the result of the operation.
buf =
print json.dumps(json.loads(buf), indent=4, sort_keys=True)