Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python type stubs generator fails on contrib/cudaoptflow module #23946

Closed
4 tasks done
asmorkalov opened this issue Jul 7, 2023 · 0 comments · Fixed by #24022
Closed
4 tasks done

Python type stubs generator fails on contrib/cudaoptflow module #23946

asmorkalov opened this issue Jul 7, 2023 · 0 comments · Fixed by #24022

Comments

@asmorkalov
Copy link
Contributor

System Information

Platform: CUDA
Python: 3.6+

Detailed description

typing_stubs_generation.nodes.type_node.TypeResolutionError: Failed to resolve "cv2" namespace against "None". Errors: 
[
'Failed to resolve "cv2.cuda" namespace against "cv2". 
Errors: [\'Failed to resolve "cv2.cuda.NvidiaOpticalFlow_1_0" class against "cv2". 
Errors: [\\\'Failed to resolve "cv2.cuda.NvidiaOpticalFlow_1_0.create" function against "cv2". 
Errors: [0]: Failed to resolve "perfPreset" argument: Failed to resolve "cuda_NvidiaOpticalFlow_1_0_NVIDIA_OF_PERF_LEVEL" exposed as "cuda_NvidiaOpticalFlow_1_0_NVIDIA_OF_PERF_LEVEL"\\\']\', 

\'Failed to resolve "cv2.cuda.NvidiaOpticalFlow_2_0" class against "cv2". 
Errors: [\\\'Failed to resolve "cv2.cuda.NvidiaOpticalFlow_2_0.create" function against "cv2". 
Errors: [0]: Failed to resolve "perfPreset" argument: Failed to resolve "cuda_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL" exposed as "cuda_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL", 
[1]: Failed to resolve "outputGridSize" argument: Failed to resolve "cuda_NvidiaOpticalFlow_2_0_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE" exposed as "cuda_NvidiaOpticalFlow_2_0_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE", 
[2]: Failed to resolve "hintGridSize" argument: Failed to resolve "cuda_NvidiaOpticalFlow_2_0_NVIDIA_OF_HINT_VECTOR_GRID_SIZE" exposed as "cuda_NvidiaOpticalFlow_2_0_NVIDIA_OF_HINT_VECTOR_GRID_SIZE", 
[3]: Failed to resolve "perfPreset" argument: Failed to resolve "cuda_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL" exposed as "cuda_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL", 
[4]: Failed to resolve "outputGridSize" argument: Failed to resolve "cuda_NvidiaOpticalFlow_2_0_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE" exposed as "cuda_NvidiaOpticalFlow_2_0_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE", 
[5]: Failed to resolve "hintGridSize" argument: Failed to resolve "cuda_NvidiaOpticalFlow_2_0_NVIDIA_OF_HINT_VECTOR_GRID_SIZE" exposed as "cuda_NvidiaOpticalFlow_2_0_NVIDIA_OF_HINT_VECTOR_GRID_SIZE"\\\']\']',

Steps to reproduce

cmake -DBUILD_opencv_cudacodec=OFF -DPYTHON3_EXECUTABLE=which python3.8 -DPYTHON_DEFAULT_EXECUTABLE=which python3.8 -DWITH_CUDA=ON -DCUDA_ARCH_BIN=61 -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules/ ../opencv-master

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)
asmorkalov pushed a commit that referenced this issue Jul 19, 2023
Fix python typing stubs generation for CUDA modules #24022

resolves #23946
resolves #23945
resolves opencv/opencv-python#871

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
thewoz pushed a commit to thewoz/opencv that referenced this issue Jan 4, 2024
…ing-cuda

Fix python typing stubs generation for CUDA modules opencv#24022

resolves opencv#23946
resolves opencv#23945
resolves opencv/opencv-python#871

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
thewoz pushed a commit to thewoz/opencv that referenced this issue May 29, 2024
…ing-cuda

Fix python typing stubs generation for CUDA modules opencv#24022

resolves opencv#23946
resolves opencv#23945
resolves opencv/opencv-python#871

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants