- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page