GUVI
Back

Object Detection with DNN : An Introduction--using YOLOV7

Created 1 year ago
97 Views
0 Comments
Bhuvaneshwarbhuvi93
@Bhuvaneshwarbhuvi93
Bhuvaneshwarbhuvi93
@Bhuvaneshwarbhuvi93Profile is locked. Login
Object Detected using YOLOv7-Image Source

Bhuvaneshwar Punniamoorthy

Object Detection: What Is It?

This is different from image recognition, which simply assigns labels to images. Object detection, on the other hand, provides more information about the image than detection.

A Computer Vision approach called Object detection finds and recognizes instances of things in an image or video. Anything from people, animals, food, automobiles, etc., could be the objects.

Object detection's purpose

When (we) humans view an image or video, we can quickly identify and pinpoint objects of interest. Object detection aims to automate the replication of this intelligence. yet how? let us know in the section below.

How Does Object Detection Work ?

Object Detection typically uses machine learning or deep learning a.k.a. Deep Neural Network to detect objects and produce a meaningful results.

Machine Learning

Machine learning can be defined as the process of inducing intelligence into a system or machine without explicit programming.

-Andrew NG, Stanford Adjunct Professor

Deep Learning

Deep learning is a field with machine learning and artificial Intelligence(A.I) that deals with algorithms inspired from functioning of human brain to help machines to gain intelligence without the need to programming them.

Computer vision accomplishes the Object Detection process through three distinct tasks:

  1. Picking objects out of image or videos.

  2. Proposing what class an object belongs to — e.g. person, bicycle, dog — using a probability score.

  3. Defining the boundaries of the proposed object using bounding box an imaginary rectangular box that contains an object.

There are two approaches to get started with object detection using deep learning:

  1. Create and train a custom object detector.

  2. Use a pretrained object detector.

--Before getting into some action let's get to know about YOLO- Real Time Object Detection.....

YOLO-You only look once

YOLOv7 -You only look once-version7 -YOLO is an object detection algorithm that uses PyTorch as its base for coding. It is famous for detecting objects in a real-time environment. YOLO uses One stage object detection technique.

YOLO uses single stage detection method.

OK, enough theory let's get down to business! Shall we?

We may use a pretrained model to detect some objects in images and videos.

Within seven steps in Google Collab, I detected some object in images and video using the YOLOv7 official repository and a pre-trained object detector. Isn't that fun MATE?

AYE AYE! You may do the same and give it a shot on your own.

Here are the before and after images and videos that I detected using YOLOv7.

Image:

Before-Object Detection

Source-Google Images

After-Object Detection

Source-Google Images

Before-Object Detection

After-Object Detection

Object Detected using YOLOv7

Video:

Before Object Detection: Click here to see the video

After Object Detection: Click here to see the video

Seven steps to wonder

--Before entering hands on in Colab make sure to set the runtime in colab to GPU.

1.Mounting Google drive into Google Colab

from google.colab import drive 
drive.mount ("/content/drive")

2.Changing Directory

%cd /content/drive/My\ Drive/ 

3.Create Directories

import os
if not os.path.isdir("Object_Detection"):
  os.makedirs("Object_Detection")

--Changing path to newly created folder

%cd Object_Detection

4.Clone Repository from official Yolov7 repository

!git clone https://github.com/WongKinYiu/yolov7.git
%cd yolov7 #Changing directory after cloning

--Store the image inside the Yolov7 folder created in Google Drive.

5.Downloading Pre-trained Model from official Yolov7 repository

!wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt

6.For Verifying

-- To verify our path is correct

!pwd

7.Running Object Detection on Image and Video

!python detect.py --weights yolov7.pt --conf 0.5 --img-size 640 --source #enter the file name after--source. Ex;--source 2.jpg

Note:

--The image with the result is saved in: runs/detect/exp'folder'/'File name'. Within the Yolov7 folder.

Links:

My Google Colab link: Click Here

Yolov7 Repository link: Click Here

Pre Trained Object Detector Link: Click Here

To know more about working of YOLO-Click Here

Interesting Applications of Object Detection

Automated vehicles

In the rapidly developing field of electric vehicles, computer vision is essential for driverless cars. The ability to identify objects, like as signs, stop signs, pedestrians, traffic lights, and other vehicles, is crucial.

Stores without cashiers

Convenience stores like Amazon Go use this model of shopping to automate the purchase, checkout, and payment processes involved in a retail transaction. These technologies include computer vision, deep learning algorithms, and sensor fusion.

Detecting Defects:

Manufactured items and products must be of high quality and free from defects. Object detection can reveal goods that don't live up to expectations. Workstations and production lines can be monitored more effectively by computers than by humans.

Learn More About Object Detection

Getting started

A Beginner's Guide to Object Detection

What Is Object Detection?

Tutorials

Object Detection with 10 line code

A Gentle Guide to Deep Learning Object Detection

Conclusion

There are some other topics related to object detection that I haven't touched on. If you dig deeper into this topic, you can learn more about its algorithm, one-stage and two-stage detection.

I'd like to thank all the bloggers who have posted about these algorithms and helped her put them all together in one article.

Comments
Please login to comment.
 
Powered by habitate.io Habitate