Hello franva, so this means that opencv doesn't have prebuilt wheels for your host. I assume you are using RaspberryPi, so here are the supported python versions for the opencv:
https://www.piwheels.org/project/opencv-python/
I would suggest using python 3.7 or 3.9 (they come preinstalled with the buster/bullseye version of the RaspberryPi OS
), so installing the library will just download the prebuilt library instead of trying (& failing) on building it. I hope this makes sense!
Thanks, Erik
Having issue for installation on RPi 4 B 4GB
erik brilliant! There is the wheel already ! haha thanks a lot!
For the opencv-contrib-python I found it here
However, it does not have the same version 4.5.3.56 as for opencv-python.
If I installed the older version opencv-contrib-python, will it cause issues?(I imagine they won't be compatible which is a big issue)
Why do I still need opencv-contrib-python even after I installed opencv-python?
Once again, thanks for your help.
Cheers,
Winston
My bad franva for not being clear; I meant that you could try using python version 3.7/3.9 and opencv-python
and opencv-conrib-python
version 4.4.0.46
(as both of these packages has prebuilt wheels).
On this note, I have opened a feature request to fix this mess so you will be able to install requirements on RPI without having to deal with all these version issues.
Thanks, Erik
Morning erik Now I understood, I can install
- Depthai 2.9.0.0
- opencv-python 4.4.0.46
- opencv-conrib-python 4.4.0.46
I have checked the Github code for DepthAI and still cannot find the version 2.9.0.0. So I hope the version 2.9.0.0 of DepthAI(DAI) will be compatible with the 4.4.0.46 of both opencv-conrib-python
(OCP) and opencv-python
(OP).
thanks erik for clarifying the installation. So I just need to install the depthai 2.9.0.0 and this lib will contain OCP and OP.
Okay, so after I installed it and a couple of other dependencies(including setup the USB rules) and I ran:
$ python3 depthai_demo.py -cnn deeplabv3p_person
/usr/lib/python3/dist-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.26.6) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
Using depthai module from: /home/pi/.local/lib/python3.7/site-packages/depthai.cpython-37m-arm-linux-gnueabihf.so
Depthai version installed: 2.9.0.0
Available devices:
[0] 14442C10013762D700 [X_LINK_UNBOOTED]
Enabling low-bandwidth mode due to low USB speed... (speed: UsbSpeed.HIGH)
Creating MJPEG link for ColorCamera node and color xlink stream...
Traceback (most recent call last):
File "depthai_demo.py", line 148, in <module>
pm.create_color_cam(nn_manager.input_size if conf.useNN else conf.previewSize, rgb_res, conf.args.rgb_fps, conf.args.full_fov_nn, xout=Previews.color.name in conf.args.show)
File "/home/pi/Work/MyBuddy/depthai/depthai_helpers/managers.py", line 662, in create_color_cam
self.mjpeg_link(self.nodes.cam_rgb, self.nodes.xout_rgb, self.nodes.cam_rgb.video)
File "/home/pi/Work/MyBuddy/depthai/depthai_helpers/managers.py", line 623, in mjpeg_link
if isinstance(node, dai.ColorCamera) or isinstance(node, dai.MonoCamera):
AttributeError: module 'depthai' has no attribute 'ColorCamera'
So this is the error I got. Could you please help?
Btw, my python3 is 3.7.3
Many thanks,
Winston
hi erik thanks for your timely update.
Excitingly, after I fixed a few other places, it finally works now!
I have created a PR for this.
https://github.com/luxonis/depthai/pull/446
I hope to contribute to this great project
Cheers,
Winston