ONE7� 2019-12-12 16:09 采纳率: 0%
浏览 1411

python face_recognition库中使用其他的功能都可以正常运行,但只有用face_encodings会报错?

已正确安装dlib和face_recognition库

代码如下:

import face_recognition

face_recognition.face_encodings("F:/multi-media/video frames/260.png")

报错如下:

PS F:\multi-media> & C:/Users/ONE7/AppData/Local/Programs/Python/Python37/python.exe "f:/multi-media/vedio analysis.py"
Traceback (most recent call last):
  File "f:/multi-media/vedio analysis.py", line 118, in <module>
    face_recognition.face_encodings("F:/multi-media/video frames/260.png", known_face_locations=None, num_jitters=1)
  File "C:\Users\ONE7\AppData\Local\Programs\Python\Python37\lib\site-packages\face_recognition\api.py", line 209, in face_encodings
    raw_landmarks = _raw_face_landmarks(face_image, known_face_locations, model="small")
  File "C:\Users\ONE7\AppData\Local\Programs\Python\Python37\lib\site-packages\face_recognition\api.py", line 153, in _raw_face_landmarks
    face_locations = _raw_face_locations(face_image)
  File "C:\Users\ONE7\AppData\Local\Programs\Python\Python37\lib\site-packages\face_recognition\api.py", line 102, in _raw_face_locations
    return face_detector(img, number_of_times_to_upsample)
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 0x0000026A438B91B0>, 'F:/multi-media/video frames/260.png', 1
  • 写回答

1条回答 默认 最新

  • u011347171 2020-03-16 15:40
    关注

    face_encodings中参数错误,应该直接放image = face_recognition.load_image_file("1.jpg")

    我的也报错了,但是我的是RuntimeError: The full_object_detection must use the iBUG 300W 68 point face landmark style.这个错误,不知道怎么回事,调用face_encodings错误,其他的都没问题

    评论

报告相同问题?

悬赏问题

  • ¥15 求解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果