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)

 

posted @ 2021-07-05 17:44  牛郎  阅读(858)  评论(0编辑  收藏  举报