Object Detection Using ImageAI

Object Detection Using ImageAI

This article takes a walkthrough of the various aspects of Computer Vision and the libraries and features, a hands-on experience of programming to detect objects with a short programming task. Computer Vision has been enabled with the rise of Machine Learning Algorithms and easily accessible libraries. Let us, take a look and experience the example in this article.

 

Object Detection

 

Object Detection is a process of detecting, locating, and identifying objects from a visual image or a video. It is a kind of Image Processing and Computer Vision technology, which are performed mainly with Machine Learning and Deep Learning implementation.

 

OpenCV

 

OpenCV ie. Open Computer Vision is a library that enables cross-platform usage to develop computer vision applications with the capability to perform real-time detection. It has been widely used for object detection, face detection, and multitudes of other use cases for image processing and video analysis applications.

 

Numpy

 

NumPy is a library that supports numerous programming languages including Python for numerical computation. It helps as an extension that adds support for huge, multi-dimensional arrays & matrices. It also consists of a large library of high-level mathematical functions which can be used to operate on these arrays.

 

Keras

 

Keras is an extremely powerful library that helps to evaluate and develop deep-learning models. It is especially used for artificial neural networks and performs as an interface for another library, Tensorflow.

 

Tensorflow

 

Tensorflow is developed by Google as an open-source library to provide an end-to-end platform for machine learning with a focus on the inference of deep neural networks.

 

Jupyter Notebook

 

Jupyter Notebook is an amalgamation of an IDE and also an educational tool for presentation which is used extensively and widely mostly for programming for scientific computing.

 

Python

 

Python is one of the easiest and widely used programming languages across the globe,

  • Taught as a beginning programming language to students
  • Clear syntax facilitates, ease of understanding and code indentation
  • Active communities of libraries and modules developers

Anaconda

 

Anaconda is a distribution for scientific computing which is an easy-to-install free package manager and environment manager and has a collection of over 720 open-source packages offering free community support for R and Python programming languages. It supports Windows, Linux, and Mac OS and also ships with Jupyter Notebook.

 

For this hand-on experience, using the anaconda environment will make it easier to follow up the programming below.

 

Managing setup for this experiment

 

First, Install Anaconda Environment, from its official site. It provides a free individual edition.

 

After, installation, open Anaconda Prompt terminal and check for any updates.

No alt text provided for this image

 Now, Install Tensorflow:

No alt text provided for this image

Install Keras

No alt text provided for this image

For, Image AI dependencies

No alt text provided for this image

 

Install ImageAI

No alt text provided for this image

Now, activate Jupyter Notebook from Anaconda and open a Python3 Shell in the notebook.


Now, we import tensorflow and check its version, 

No alt text provided for this image

Import, os, keras and sys,

No alt text provided for this image

Now, we import ImageClassification from ImageAI,

No alt text provided for this image


For obtaining the execution link of the current notebook,

No alt text provided for this image

ResNet50

 

ResNet stands for Residual Network which is a classic neural network extensively use for tasks of computer vision and is a backbone for CV-related problems. ResNet-50 is one of the variants of the ResNet Model which has 50 layers deep convolutional layers with 1 Average Pool layer and 1 MaxPool.

 

Variable (detection) calls in ImageClassification to detect our input imagesand Deep Learning Model type is set for ResNet50,

No alt text provided for this image

   

“resnet50_imagenet_tf.2.0.h5” must be downloaded to the execution path location from the source code at Github.

No alt text provided for this image

Now loading, the model.

No alt text provided for this image

Save the image you want to classify on your executionpath location. 

No alt text provided for this image

Now, the detection is performed.

No alt text provided for this image

  

The image, used can be displayed on the notebook using, 

No alt text provided for this image
No alt text provided for this image


The output, shows, 59% probability that the image is of a sports car, 22.9% of a racer, 10.057985037565231% that it's of a car wheel, 2.2967111319303513% that it’s a convertible, and 1.2311830185353756% that it’s a go-kart.

No alt text provided for this image

 

In this article, we had a hands-on experience of using libraries for the detection of objects and programmed in python using jupyter notebook on the anaconda platform. With such minimal, programming we could detect a random object. This is the output of the years of research and investment of multitudes of scientists and engineers to create the libraries and software described in the article above. With this example, it is established how easy it is to experiment with computer vision tasks with this example of object detection.


Read more similar articles at my C# Corner Profile: https://bit.ly/3wYzT0B

要查看或添加评论,请登录

Ojash Shrestha的更多文章

  • Azure Cognitive Services

    Azure Cognitive Services

    In this article, we’ll learn about the Azure Cognitive Services, how it integrates into various other tools provided by…

    2 条评论
  • XGBoost 101

    XGBoost 101

    XGBoost 101 In the previous article, we got introduced to XGBoost and learned about various reasons for its wide…

  • XGBoost — The Undisputed GOAT!

    XGBoost — The Undisputed GOAT!

    In this article, we’ll learn about XGBoost, its background, its widely accepted usage in competitions such as Kaggle’s…

  • Amazon SageMaker

    Amazon SageMaker

    In this article, we’ll learn about Amazon SageMaker and various tools provided by it for Machine Learning purposes. The…

  • How To Connect VS Code To AWS

    How To Connect VS Code To AWS

    In this article, we’ll learn briefly about Amazon Web Services (AWS) and then go through a hands-on procedure to…

  • Benefits And Risks Of Cloud Computing

    Benefits And Risks Of Cloud Computing

    Various aspects of Cloud Computing, its major characteristics, and a comparative analysis between different cloud…

  • Major Characteristics Of Cloud Computing

    Major Characteristics Of Cloud Computing

    In this article, we’ll learn about Cloud Computing and its different characteristics. These constitute the major…

  • AWS VS Azure VS Google Cloud — Comparative Analysis Of Cloud Platforms For Machine Learning

    AWS VS Azure VS Google Cloud — Comparative Analysis Of Cloud Platforms For Machine Learning

    There are numerous cloud platforms providing services for machine learning. This article discusses the comparative…

    1 条评论
  • Properties of Modeling And Deployment Of Machine Learning Application

    Properties of Modeling And Deployment Of Machine Learning Application

    In this article, we’ll learn about the various properties of modeling and deployment of machine learning applications…

  • Using Container For Machine Learning Application

    Using Container For Machine Learning Application

    In the last article, we discussed deployment and production environment such that it consisted of two primary programs,…

社区洞察

其他会员也浏览了