提交工单
咨询集成、功能及报价等问题
The ZegoEffects SDK provides a face detection function, which can detect all faces in a video and the positions of the faces in the video images.
Before you begin to use the SDK's face detection feature in your project, make sure you complete the following steps:
FaceDetectionModel
. For details, see Import models.To use the face detection feature, import the model file FaceDetectionModel
first; otherwise, this feature can't take effect. For details, see Import resources and models.
Call the setEventHandler
method to set the callback to return the face detection result.
// Set the callback to return the face detection result.
[self.effects setEventHandler:self]
Call the enableFaceDetection
method to enable the face detection feature.
// Enable face detection.
[self.effects enableFaceDetection:YES];
-(void)effects:(ZegoEffects *)effects faceDetectionResults:(NSArray<ZegoEffectsFaceDetectionResult *> *)results{
// Obtain the face detection result, including the number of faces, the confidence level of each detected face and its position.
}