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

How to use OpenCV DNN Module on Windows with c++ #824

Open
kabiri opened this issue May 23, 2023 · 3 comments
Open

How to use OpenCV DNN Module on Windows with c++ #824

kabiri opened this issue May 23, 2023 · 3 comments

Comments

@kabiri
Copy link

kabiri commented May 23, 2023

Hello
How to use OpenCV DNN Module CPU only on Windows with c++
How to install and config it?

@brmarkus
Copy link

Other than MS-Windows and C++ - do you have something specific in mind?

Have you tried following e.g. "https://docs.opencv.org/4.7.0/d3/d52/tutorial_windows_install.html" (for e.g. version v4.7 or any other version to select from the drop-down field in the upper-left corner)?

Do you need or have to build from source on your own?

Do you need a specific backend (like for NVIDIA-GPUs or Intel-GPUs/CPUs/VPUs, like using OpenVINO)?

When it is about an Intel-based environment (like CPU, GPU, VPU, FPGA), would it be possible for you to use OpenVINO (build from source or pre-built) (in the latest versions of OpenVINO there is no OpenCV contained anymore, but providing instructions for how to get it, how to install, which version to use as a specific version of OpenVINO is validated using a specific version of OpenCV)?

@kabiri
Copy link
Author

kabiri commented May 23, 2023

I built OpenCV 4.7 on Windows using CMake for GCC. However, I couldn't build Caffe. I installed TensorFlow on GCC and successfully ran a test program with it. But when I run the examples from this repository, the program gets stuck at the net.forward line without any error.

That's why I installed Microsoft Visual Studio 2022 Community and I want to install and configure OpenCV 4.7 for it. The reason I asked these questions here was to make sure that I have done everything correctly.

Since I don't have an NVIDIA graphics card, I want to use DNN with CPU.

@brmarkus
Copy link

Could be a version conflict (e.g. version and/or supported layers and/or operations of the model) between the used framework (Tensorflow) and the model.

Maybe additional logs during loading of DNN might help via enableModelDiagnostics():
https://docs.opencv.org/4.x/d6/d0f/group__dnn.html#ga9c06b170a462e97b413163aadb9869f9

Not every example documents the needed requirements (or documentation or requirements.txt is outdated), or sample-resources (like model-file) (like "the model-file X was created/trained/exported using Framework Y in version Z").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants