我正在获取调用face_encodings函数的时间。
TypeError: __call__(): incompatible function arguments. The following argument types are supported:
1. (self: dlib.fhog_object_detector, image: array, upsample_num_times: int=0) -> dlib.rectangles
Invoked with: <dlib.fhog_object_detector object at 0x7f066f834340>, '36121754-36121734.jpg', 2以下是我的代码
img = plt.imread(face)
plt.imshow(img)
x=face_recognition.load_image_file(face)
x_code = face_recognition.face_encodings(face)[0]图像路径是正确的,当我尝试输出图像时,它显示load_image_file()正在执行并返回一个数字数组。
我不确定我哪里出错了。
错误很可能是输入类型为load_image_file或face_encodings
发布于 2021-02-06 21:00:54
问题出在我传递给face_encoding()的参数变量
正确:
x=face_recognition.load_image_file(face)
x_code = face_recognition.face_encodings(x)[0]原因:
根据人脸识别库,load_image_file就像一个初始函数,我们在其中传递文件并将其存储在一个变量中(在我的例子中,变量是x)
稍后,对于face_recognition包的任何其他函数,我们必须传递变量x,而不是文件名。
PS :那个错误的细节仍然让我害怕
https://stackoverflow.com/questions/66077056
复制相似问题