Opencv_contrib: ImportError: cannot import name 'dnn_superres'

Created on 25 May 2020  Â·  5Comments  Â·  Source: opencv/opencv_contrib

System information (version)
  • OpenCV => : 4.2.0
  • Operating System / Platform => : Windows 64 Bit
  • Compiler => : Visual Studio 2017
Detailed description

I have install opencv-contrib use pip install opencv-contrib-python in cmd, but when use it for super_resolution it will get error ImportError: cannot import name dnn_superres.

Steps to reproduce


image

Issue submission checklist
  • [ ] I report the issue, it's not a question
  • [x] I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution

  • [ ] I updated to latest OpenCV version and the issue is still there
  • [ ] There is reproducer code and related data files: videos, images, onnx, etc

  • Most helpful comment

    I also have this error although I have open cv 4.4.0 installed (& python 3.7.6)

    I have the same issue too. The pre-compile version (installed through pip) is not including yet as per stated here

    EDIT: I recompile opencv with the guide from here

    EDIT EDIT: It's should be included in the latest version. Quoted from the pypi project. I solved the problem by only install the opencv-contrib-python and uninstall the opencv-python.

    Option 1 - Main modules package: pip install opencv-python
    Option 2 - Full package (contains both main modules and contrib/extra modules): pip install opencv-contrib-python (check contrib/extra modules listing from OpenCV documentation)

    All 5 comments

    same

    OpenCV => : 4.2.0

    the python wrappers came after that release, see https://github.com/opencv/opencv_contrib/commit/8ab145c4bba38511896b22b6543747449d980cd2

    I also have this error although I have open cv 4.4.0 installed (& python 3.7.6)

    I also have this error although I have open cv 4.4.0 installed (& python 3.7.6)

    I have the same issue too. The pre-compile version (installed through pip) is not including yet as per stated here

    EDIT: I recompile opencv with the guide from here

    EDIT EDIT: It's should be included in the latest version. Quoted from the pypi project. I solved the problem by only install the opencv-contrib-python and uninstall the opencv-python.

    Option 1 - Main modules package: pip install opencv-python
    Option 2 - Full package (contains both main modules and contrib/extra modules): pip install opencv-contrib-python (check contrib/extra modules listing from OpenCV documentation)

    firstly, the version in my computer is opencv-python.
    I tried to install opencv-contrib-python, it works now.
    usage:
    pip uninstall opencv-python
    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-contrib-python

    Was this page helpful?
    0 / 5 - 0 ratings