You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't have a specific question more than "What should be done about cv2?". So let me lay down my thoughts as well as the current state of using types with the cv2 package.
You have to copy and track a massive file into your own project.
You have to manually check for any update to the stub
python-type-stubs is not super responsive to PRs (their maintainers have other priorities, which is quite understandable). And you have to sign the Microsoft CLA.
stubs are not included with all popular type-checkers.
Visibility for those stubs (both for users and would-be contributors) is not as good as, let's say, typeshed.
But my goal with all of these stubs is to not own them forever, so ideally they do all eventually end up either in typeshed or handed off to the package owners.
There has been some work to generate types from OpenCV, which would be the best long-term solution. But work has stalled indefinitely opencv/opencv#20370
I'd like to have proper access to cv2 stubs sooner rather than later. The Microsoft stubs are far from complete (cv2 is massive), but it's already a great starting point (and I also have a few improvements I had to add). I'd like to bring those stubs to typeshed, especially now that I've gained some experience doing so, but I also wanna hear your thoughts before I get started with it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I don't have a specific question more than "What should be done about cv2?". So let me lay down my thoughts as well as the current state of using types with the cv2 package.
Currently, the best way to type cv2 in a project, is to copy the types from https://github.com/microsoft/python-type-stubs/tree/main/cv2 directly into your projects (see https://github.com/Avasam/Auto-Split/tree/2.0.0/typings/cv2-stubs). This is problematic because:
As some of you are already aware, there has been talks of publishing those stubs to PyPI (microsoft/python-type-stubs#211). Which would alleviate point 1 and 2, but I have no idea about progress or an ETA on that. Anyway, according to @gramster : (microsoft/python-type-stubs#211 (comment))
There has been some work to generate types from OpenCV, which would be the best long-term solution. But work has stalled indefinitely opencv/opencv#20370
I'd like to have proper access to cv2 stubs sooner rather than later. The Microsoft stubs are far from complete (cv2 is massive), but it's already a great starting point (and I also have a few improvements I had to add). I'd like to bring those stubs to typeshed, especially now that I've gained some experience doing so, but I also wanna hear your thoughts before I get started with it.
Beta Was this translation helpful? Give feedback.
All reactions