SpectacularAI / sdk

Spectacular AI SDK
https://www.spectacularai.com/
71 stars 12 forks source link

Unable to get the color property from a spectacularAI.depthai.Pipeline #1

Closed Suisse00 closed 2 years ago

Suisse00 commented 2 years ago

I was trying to access the color property in a spectacularAI.depthai.Pipeline instance and I get Unable to convert function return value to a Python type! error on the 1.5.0 release from PIP on python 3.9.5 x64

kaatrasa commented 2 years ago

Hey, thanks for reporting the issue.

Accessing spectacularAI.depthai.Pipeline.color (i.e. the depthAI color camera) requires you to set config.useColor = true. Also, note that useColor is only supported for OAK-D series 2, so this will not help with older devices. The documentation & handling of this issue will be improved in an upcoming release (probably 1.6.1).

Suisse00 commented 2 years ago

Also, note that useColor is only supported for OAK-D series 2 Hum, then you may need to document what this property is because OAK-D series 1 do have a RGB camera as well. So if it isn't for that RGB camera then I'm likely not to be the only one clueless.

To come back to that exception, thanks for the clarification. That totally makes sense to throw an exception then! However, may I suggest you to throw your own exception with the reason into it (I guess it is possible with pyd)? It would be way easier for everyone (including possibly end-user if it is unhandled)

kaatrasa commented 2 years ago

The main issue is that there is currently no reliable way to determine the OAK-D device generation; OAK-D series 1 has a RGB camera, but it is not synchronized with the stereo cameras.

However, in the next release, we have clarified this issue in the documentation & accessing the spectacularAI.depthai.Pipeline.color property now returns None when config.useColor = false instead of crashing.

kaatrasa commented 2 years ago

We have now addressed this issue in the most recent release (1.7.0): https://github.com/SpectacularAI/sdk/releases