Python argument types did not match C++ signature

问题

我佛了,我的博客访问也太慢了吧。

dlib在windows下兼容性不好,不过也不是不能用。

1
2
3
4
5
Boost.Python.ArgumentError: Python argument types in
rectangle.__init__(rectangle, numpy.int32, int, int, int)
did not match C++ signature:
__init__(struct _object * __ptr64, long left, long top, long right, long bottom)
__init__(struct _object * __ptr64)

一路定位

1
2
3
4
5
6
7
8
def _css_to_rect(css):
"""
Convert a tuple in (top, right, bottom, left) order to a dlib `rect` object

:param css: plain tuple representation of the rect in (top, right, bottom, left) order
:return: a dlib `rect` object
"""
return dlib.rectangle(css[3], css[0], css[1], css[2])


return dlib.rectangle(css[3], css[0], css[1], css[2])
改成
return dlib.rectangle(int(css[3]), int(css[0]), int(css[1]), int(css[2]))

问题解决

Python argument types did not match C++ signature

https://lyq.blogd.club/2019/03/02/dlib/

Author

lyq1996

Posted on

2019-03-02

Updated on

2021-11-07

Licensed under

Comments