Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

running openvino in docker

SidneyZ
Beginner
383 Views

Hi:

I've running latest openvino in docker on ubuntu.

docker run -ditu root:root --name=openvino -h "openvino" --privileged \
--device /dev/dri:/dev/dri \
-v /docker-share/public:/public  \
openvino/ubuntu20_dev:latest

but in the docker, cv2.VideoCapture return (false, none)

import argparse
import cv2

ap = argparse.ArgumentParser()
ap.add_argument("-v", "--video", required=False, help="path to the video file")
args = vars(ap.parse_args())

cap = cv2.VideoCapture(args["video"])
print(args["video"])

ret, frame = cap.read()
print("ret: {}", format(ret))
(frame_h, frame_w , frame_d)  = frame.shape

cv2.waitKey(0)

 


road.mp4
ret: {} False
Traceback (most recent call last):
File "test.py", line 25, in <module>
(frame_h, frame_w , frame_d) = frame.shape 
AttributeError: 'NoneType' object has no attribute 'shape'

 

seems my cv in openvino docker could not work.

 

How can I solve it?

Thanks 

Sidney

 

0 Kudos
2 Replies
Iffa_Intel
Moderator
361 Views

Hi,

 

did you check whether your system really had installed the OpenCV? (pip show opencv or pip show opencv-python)

Try to pip install opencv-python

 

Or if you are using Linux, run the command:

sudo apt update

sudo apt install python3-opencv

 

verify the OpenCV installation:

python3 -c "import cv2; print(cv2.__version__)"

 

Sincerely,

Iffa

 

 

0 Kudos
Iffa_Intel
Moderator
348 Views

Greetings,


Intel will no longer monitor this thread since we have provided a solution. If you need any additional information from Intel, please submit a new question.



Sincerely,

Iffa


0 Kudos
Reply