ahmad iqbal
ahmad iqbal

Reputation: 387

module 'cv2.cv2' has no attribute 'dnn_superres'

I am trying to upscale image (performing super resolution) using OpenCV, but I am getting this error that module 'cv2.cv2' has no attribute 'dnn_superres'. Any help would be greatly appreciated.

I am using 4.4.0.44 OpenCV version. Here is the code section.

import cv2
sr = cv2.dnn_superres.DnnSuperResImpl_create()
sr.readModel(args["model"])
sr.setModel(modelName, modelScale)

Upvotes: 12

Views: 14277

Answers (1)

Elie Eid
Elie Eid

Reputation: 981

In case you are using python3, you need to download opencv with pip3

First uninstall opencv:

 pip uninstall opencv-python
 pip uninstall opencv-contrib-python

Then install latest version of opencv with pip3:

pip3 install opencv-contrib-python

Upvotes: 15

Related Questions