Closed MurphyZhangFC closed 3 months ago
What's your Numpy version? I bet it's 2.0. Try with 1.26. If you absolutely need Numpy 2.0 try building from master.
What's your Numpy version? I bet it's 2.0. Try with 1.26. If you absolutely need Numpy 2.0 try building from master.
@arrufat It works for me, Thank you!
@davisking Maybe PyPI's dlib should be updated, as I guess we'll have more and more of bug reports like this, as NumPy 2.0 becomes more widespread.
Yeah, just pushed the latest dlib to PyPI. Hopefully we see less issues.
Yeah, just pushed the latest dlib to PyPI. Hopefully we see less issues.
Just curious - are the changes in the latest dlib on PyPI just to adjust the numpy version requirements, or code changes to support numpy 2.0?
Thanks!
As far as I understand, you should be good to go with dlib v19.24.5.
I understand, but I was curious what the changes were for v19.24.5 😄
Not much: https://github.com/davisking/dlib/compare/v19.24.4...v19.24.5
In Python, just a bug fix to the newly introduced load_rgb_alpha_image
function.
Ah I see, thanks - didn't realize there was a github tag for the versions as well!
Actually, it does seem like there was also an additional pybind11 cmake option exposed: https://github.com/davisking/dlib/compare/v19.24.4...v19.24.5#diff-5bb9350d3c305fa87fad69732e4dcfe993fa9134993056e46b70aaf6b24baae0R114
What Operating System(s) are you seeing this problem on?
macOS (Apple Silicon)
dlib version
19.24.4
Python version
3.10
Compiler
appleclang15
Expected Behavior
I want to read some images for testing.
Current Behavior
I am encountering a RuntimeError when using dlib.load_rgb_image in my code. Here is the error message: `Traceback (most recent call last): File "/Users/**/test.py", line 7, in
img = dlib.load_rgb_image("test.jpg")
RuntimeError:
Error detected at line 111. Error detected in file /private/var/folders/b3/kmnj2pcj591_hr2nb1qntkr80000gn/T/pip-install-iu67w7fx/dlib_489a4994c89d4706a72473336f69874d/dlib/../dlib/python/numpy_image.h. Error detected in function auto dlib::assert_is_image(const py::array &)::(anonymous class)::operator()(char, size_t) const.
Failing expression was false. unknown type`
Steps to Reproduce
detector = dlib.get_frontal_face_detector()
img = dlib.load_rgb_image("test.jpg")
faces = detector(img)
print("Number of faces detected: {}".format(len(faces)))`
Anything else?
I have tried running the same code on different computers and operating systems, but the same error occurs. Additionally, I have attempted to preprocess the image using OpenCV, but the error persists. I also have verified that the image file test.jpg exists and is accessible. The error seems to occur specifically when calling dlib.load_rgb_image.
Any help in resolving this issue would be greatly appreciated.