openvinotoolkit / open_model_zoo

Pre-trained Deep Learning models and demos (high quality and extremely fast)
https://docs.openvino.ai/latest/model_zoo.html
Apache License 2.0
4.1k stars 1.37k forks source link

[ ERROR ] Cannot open input file or camera: ... #79

Closed andreyfe1 closed 5 years ago

andreyfe1 commented 5 years ago

Hi open_model_zoo, I've got the OpenVINO R5 (latest version), configured it and tried to build and run the demo (models were downloaded). When I pass input as a camera (-i cam) it works good. When I pass an image it fails with error

>interactive_face_detection_demo.exe -i <path to zoo>\open_model_zoo\intel_models\age-gender-recognition-retail-0013\description\age-gender-recognition-retail-0001.jpg -m <path to model>\face-detection-adas-0001.xml -m_ag <path to model>\age-gender-recognition-retail-0013.xml
InferenceEngine:
        API version ............ 1.4
        Build .................. 19154
[ INFO ] Parsing input parameters
[ INFO ] Reading input
[ ERROR ] Cannot open input file or camera: <path to zoo>\open_model_zoo\intel_models\age-gender-recognition-retail-0013\description\age-gender-recognition-retail-0001.jpg

Could you please help me what I'm doing wrong?

snosov1 commented 5 years ago

Hey, @capatober !

The reason is, probably, that VideoCapture expects an image sequence, not a single image. Please, refer to documentation:

filename – name of the opened video file (eg. video.avi) or image sequence 
(eg. img_%02d.jpg, which will read samples like img_00.jpg, img_01.jpg, img_02.jpg, ...)
mshabunin commented 5 years ago

Image sequence backend has been broken in OpenCV 4.0.1-openvino (https://github.com/opencv/opencv/releases/tag/4.0.1-openvino), fix was introduced in OpenCV 4.0.1 (https://github.com/opencv/opencv/releases/tag/4.0.1) in this PR: opencv/opencv#13441

Reproduced in OpenVINO 2018R5. Checked OpenVINO 2019R1 - works fine.

andreyfe1 commented 5 years ago

@mshabunin, Thanks a lot for the answer. I've checked with OpenVINO 2019R1. It works without that error. But result looks unreadable. image Also when I try to run with the age-gender-recognition-retail-0002.png image it looks like the age-gender-recognition-retail-0003.png image is taken because I get an output as with the age-gender-recognition-retail-0003.png image

mshabunin commented 5 years ago

But result looks unreadable.

Yes, looks like visualization can be improved, e.g. recognition label is not visible if the bounding rectangle is on top of the frame. Perhaps the sample is meant to be run on higher resolution video and for other cases it can print detection information to the console (-r option).

Also when I try to run with the age-gender-recognition-retail-0002.png image it looks like the age-gender-recognition-retail-0003.png image is taken because I get an output as with the age-gender-recognition-retail-0003.png image

This happens because these images are considered a 2-frame video and you only see the last frame:

[ INFO ] Number of processed frames: 2
[ INFO ] Total image throughput: 30.4477 fps
[ INFO ] Execution successful

As I understand these images are not meant to be used as an input after all, but serve as a documentation illustration.

andreyfe1 commented 5 years ago

I see. -r works well. Thanks a lot

bhaswa commented 5 years ago

I am getting the same error with openvino 2019R1 in windows while working with videos or cameras. But it is not giving any error while giving any .jpg or .png images. Please help.

image