OpenCV-python 4.10.0.84
Python 3.12
我正在处理此图像:https://drive.google.com/file/d/1YqLiwUmFC0Nh7O1_ee6Z4hpefEygnEIN/view?usp=sharing。这是jpg
import cv2
import face_recognition
def face_fun(image_file_path):
# Load the image
image = cv2.imread(image_file_path)
rgb_image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
# Find all the faces and face encodings in the image
face_locations = face_recognition.face_locations(rgb_image) # Exception thrown
解决方案是将 numpy 降级到 1.26.0。这解决了我的问题。 请参阅 [[已解决]] 人脸识别测试失败且图像正确