Image classification using OpenVINO

Let's see how we can use the image classification demo present in OpenVINO's installation directory:

  1. First, move to the deployment_tools/demo directory in your OpenVINO installation directory.
  2. Next, let's run image classification on a demo image that's already present in the directory:
./demo_squeezenet_download_convert_run.sh

Here's the result that I obtained:

Let's also run another demo that uses the same image, the inference pipeline demo, which shows the speed of OpenVINO's Inference Engine quite well:

./demo_security_barrier_camera.sh

Here's the output image:

Since we are using the same image in both cases, take a minute and see the results you obtained for image classification. Can you see how accurate the predicted classes were?

Now, you might be wondering, when I already have an OpenVINO demo of image classification, why should I use OpenCV? Let's consider a scenario where you have a huge image but you only want to classify objects present in a fixed frame. If you use OpenVINO's demo, you will get the results for the entire image. But with OpenCV, you can first crop out the Region Of Interest (ROI) and then perform image classification.

As we discussed, OpenVINO IE in itself is not very flexible and, when it comes to computer vision tasks, there is nothing better than OpenCV. Fortunately, with OpenCV, it is possible to use the speedup of OpenVINO's Inference Engine along with the Computer Vision functions of OpenCV.

Let's go back to the Using OpenVINO Inference Engine with OpenCV section, where we saw how to specify OpenVINO Inference Engine as the backend in the dnn module of OpenCV. Let's see how we can use this for an image classification problem.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset