1. (self: _dlib_pybind11.shape_predictor, image: array, box: _dlib_pybind11.rectangle) -> _dlib_pybind11.full_object_detection 已解决

基于dlib识别人脸68个关键点:

predictor = dlib.shape_predictor('res/model.dat')
predictor(gray, det)

使用cnn提取特征时,偶尔会报错:

1. (self: _dlib_pybind11.shape_predictor, image: array, box: _dlib_pybind11.rectangle) -> _dlib_pybind11.full_object_detection

原因:

box格式应该是 rectangles,但错误输入mmod_rectangles的格式

正确做法:

predictor = dlib.shape_predictor('res/model.dat')
det = det.rect
predictor(gray, det)
原文地址:https://www.cnblogs.com/niulang/p/14973582.html