luxonis / depthai-python

DepthAI Python Library
MIT License
353 stars 192 forks source link

[bug] numpy 2.0.0 breaks ImgFrame #1041

Open bherbruck opened 3 months ago

bherbruck commented 3 months ago

The latest version of numpy (v2.0.0) seems to break dai.ImgFrame. It is auto-installed when installing the depthai package.

Specifically, it causes frames to be a single grayscale color.

I recommend hard-coding the version into the build-tools or updating the library to work with it, could be an opencv thing. This could break all past versions that don't have a pinned version of numpy (or maybe opencv) in requirements.txt. I had this issue on opencv-python==4.10.0.84 and every depthai>=2.0.0.0.

A workaround is to do this in your requirements.txt

numpy<2.0.0  # this is necessary to ensure proper functionality
opencv-python==<any-version>
depthai==<any-version>
moratom commented 3 months ago

@bherbruck thanks for the report!

We've updated the requirements on main and are working on a release with support for the new numpy.

Unfortunately we didn't have this as requirement on previous versions, we'll do our best to put a warning in our documentation for the older versions. CC: @jakaskerl

moratom commented 3 months ago

Linking the PR as well https://github.com/luxonis/depthai-python/pull/1039