img=cv2.imread(face.jpg)
predictions= DeepFace.analyze(img)
Run Code Online (Sandbox Code Playgroud)
Error: Face could not be detected. Please confirm that the picture is a face photo or consider to set enforce_detection param to False.
设置enforce_detection为False会导致即使图像中没有面部,它也会读取情绪
我们如何处理这个错误,让它告诉我们没有人脸?