Issue 1:
OpenCV => 4.1 (opencv-python-headless 4.1.1.26)

Operating System / Platform => AWS ec2 instance running Ubuntu 18.04 AMI

Compiler => Whatever opencv-python uses to build the wheel

Detailed description

We encountered this bug at my place of work when extracting frames from a large number of videos. A cv2.VideoCapture instance from the opencv-python library would report success on reading frames that were beyond the end of the video file in question.

I understand that this bug might be impossible to reproduce and I can't provide as much detail as I'd like to. There is also a fairly easy workaround I've put in place in case we don't find out the root cause, so don't hesitate to close this issue if you can't work with it.

Nevertheless, I thought I would share this here on the off-chance that it's helpful or this is a known issue that has been fixed in a more recent version of OpenCV or may be fixed in a future release.

Steps to reproduce

Unfortunately, I've only seen this happen on ec2 instances at my place of work, with video files I'm not a liberty to share.

However, below are the steps I took to confirm that the OpenCV python bindings or OpenCV itself was the cause of the bug. I ran an ipython shell on one of our virtual machines which was experiencing this issue:

In [1]: import cv2

In [2]: vc = cv2.VideoCapture('/tmp/tmpdoromkcr')

In [3]: frame_count = vc.get(cv2.CAP_PROP_FRAME_COUNT)

In [4]: frame_count
Out[4]: 62991.0

In [5]: vc.set(cv2.CAP_PROP_POS_FRAMES, frame_count - 3600)
Out[5]: True

In [6]: success, frame = vc.read()

In [7]: success
Out[7]: True

In [8]: frame
Out[8]:
array([[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]],

[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]],

[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]],

...,

[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]],

[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]],

[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]]], dtype=uint8)

In [9]: frame.mean()
Out[9]: 0.0018798225308641976

In [10]: vc.set(cv2.CAP_PROP_POS_FRAMES, frame_count + 9999999999)
Out[10]: True

In [11]: success, frame = vc.read()

In [12]: success
Out[12]: True

In [13]: frame
Out[13]:
array([[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]],

[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]],

[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]],

...,

[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]],

[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]],

[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
...,
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]]], dtype=uint8)

In [14]: frame.mean()
Out[14]: 0.0

Issue 2:
System information (version)

OpenCV => :4.2.0:

Operating System / Platform => :Windows 7 4 Bit:

Compiler =>:Not available:

Openvino => :2020.1:

Running on CPU

Detailed description

Importing model face-detection-adas-0001 Throws an error saying

Traceback (most recent call last):

File "feed_network.py", line 50, in

load_to_IE('C:\Users\ra\Desktop\projects\Entertainment\age-gender-face

-detection-project\models\face-detection-adas-0001\FP16\face-detection-adas-

0001.xml')

File "feed_network.py", line 45, in load_to_IE

plugin.load_network(net, device_name='CPU')

File "ie_api.pyx", line 134, in openvino.inference_engine.ie_api.IECore.load_n

etwork

File "ie_api.pyx", line 141, in openvino.inference_engine.ie_api.IECore.load_n

etwork

RuntimeError: Failed to create plugin C:\Program Files (x86)\IntelSWTools\openvi

no\deployment_tools\inference_engine\bin\intel64\Release\MKLDNNPlugin.dll for de

vice CPU

Please, check your environment

Cannot load library 'C:\Program Files (x86)\IntelSWTools\openvino\deployment_too

ls\inference_engine\bin\intel64\Release\MKLDNNPlugin.dll': 3221225501 from cwd:

C:\Users\ra\Desktop\projects\Entertainment\age-gender-face-detection-project\han

dling_inference

Steps to reproduce

My code is

#def load_to_IE(model_xml):
##load the inference engine api
plugin = IECore()
#Load IR files into their related class
model_bin = os.path.splitext(model_xml)[0] + '.bin'
net = IENetwork(model=model_xml, weights=model_bin)
#load the network in the inference engine
plugin.load_network(net, device_name='CPU')
print("IR loaded successfully")

return

load_to_IE('C:\\Users\\ra\\Desktop\\projects\\Entertainment\\age-gender-face-detection-project\\models\\face-detection-adas-0001\\FP16\\face-detection-adas-0001.xml')