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.
6392 Discussions

How to provide input images during inference with OpenViNO toolkit

Mandhyan__Gulshan
905 Views

Hi, I am running a simple LeNet Model using the Intel Inference Engine from the Open on my CPU.

The only part i am confused about is how should the input data be provided for the Inference Engine and is there any preprocessing or resizing that needs to be done beforehand.

I am getting the below error while running my LeNet model with Intel inference Engine:

(tensorflow) gulshan@gulshan-HP-Pavilion-Notebook:~/intel/computer_vision_sdk_2018.3.343/deployment_tools/inference_engine/samples/build/intel64/Release$ ./classification_sample -i t10k-images.idx3-ubyte -m
 frozen_model_without_dropout.xml
[ INFO ] InferenceEngine:
    API version ............ 1.2
    Build .................. 13911
[ INFO ] Parsing input parameters
[ INFO ] Loading plugin

    API version ............ 1.2
    Build .................. lnx_20180510
    Description ....... MKLDNNPlugin
[ INFO ] Loading network files:
    frozen_model_without_dropout.xml
    frozen_model_without_dropout.bin
[ INFO ] Preparing input blobs
[MNIST] Warning: number_of_images  in mnist file equals 10000. Only a first image will be read.
[ WARNING ] Image won't be resized! Please use OpenCV.
[ ERROR ] Valid input images were not found!

In this case i have chosen the batch size as 1 while creating the IR representation with Model Optimizer.

Regards,

Gulshan

0 Kudos
3 Replies
Mark_L_Intel1
Moderator
905 Views

Hi Gulshan,

The error is in file <OpenCV install dir>/inference_engine/samples$ vi common/format_reader/bmp.h, it has following lines when the image reader is trying to parse the image data:

    std::shared_ptr<unsigned char> getData(int width, int height) override {
        if ((width * height != 0) && (_width * _height != width * height)) {
            std::cout << "[ WARNING ] Image won't be resized! Please use OpenCV.\n";
            return nullptr;
        }

So please make sure:

  • This file is a bmp file.
  • The image size qualify the conditions above. Where _height and _width should come from BMPInfoheader in bmp.cpp

Mark

0 Kudos
Mark_L_Intel1
Moderator
905 Views

Hi Gulsan,

Are you using the data set from the following site:

https://github.com/zalandoresearch/fashion-mnist

According to its document, all the data set has to be read by minst_reader.py method, I believe this could extract the file t10k-images.idx3-ubyte into the single bmp images.

You can then input into our sample code,

did you try that?

Mark

 

0 Kudos
Mandhyan__Gulshan
905 Views

I tried doing that now. I am getting the below error for "Incorrect Output Dimensions". Do you know why this would be?

(carnd-term1) gulshan@gulshan-HP-Pavilion-Notebook:~/intel/computer_vision_sdk_2018.3.343/inference_engine/samples/build/intel64/Release$ ./classification_sample -i digit.bmp -m frozen_model_without_dropout.xml
[ INFO ] InferenceEngine:
    API version ............ 1.2
    Build .................. 13911
[ INFO ] Parsing input parameters
[ INFO ] Loading plugin

    API version ............ 1.2
    Build .................. lnx_20180510
    Description ....... MKLDNNPlugin
[ INFO ] Loading network files:
    frozen_model_without_dropout.xml
    frozen_model_without_dropout.bin
[ INFO ] Preparing input blobs
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ ERROR ] Incorrect output dimensions for classification model

 

Regards,

Gulshan

 

0 Kudos
Reply