The file that is used to provide this can be found by doing python -m pip show depthai
and using the Location to see the filed under directory [Location]/depthai/__init__.pyi
and node.pyi
Regarding getFrame
that could be fixed by specifying that DataOutputQueue.get
could return ADatatype
OR any of its descendants (As of right now, the typed information doesn't point to that, so IDEs cannot know that it might return subclasses as well). That could be done using overloads, similarly to Pipeline.create
.
If you'd like to check it out how these are done, see depthai-python/generate_stubs.py
. It uses stubgen and mypy to check if stubs can be parsed correctly.
Any improvements are welcome
Regarding VSCode, it AFAIK uses a different typing system underneath and it might have more issues without any additional configuration. I've only tested it briefly there.
Best regards,
Martin