YOLO v3 Object Detection with Keras

栏目: IT技术 · 发布时间: 5年前

内容简介:“You Only Look Once” (YOLO) is an object detection algorithm that is known for its high accuracy while it is also being able to run in real-time due to its speed detection. Unlike the previous algorithm, the third version facilitates an efficient tradeoff

An Explanation of YOLO v3 in a nutshell with Keras Implementation

Video by YOLO author,

Joseph Redmon

About YOLO v3 Algorithm

“You Only Look Once” (YOLO) is an object detection algorithm that is known for its high accuracy while it is also being able to run in real-time due to its speed detection. Unlike the previous algorithm, the third version facilitates an efficient tradeoff between speed and accuracy simply by changing the size of the model where retraining is not necessary.

Before we start to implement object detection with YOLO v3, we need to download the pre-train model weights . Downloading this may take a while, so you can prepare your coffee while waiting. YOLO v3 is written in the DarkNet framework which is open-source Neural Network in C. This makes me feel so intimidated in the first place.

But thankfully, this code is strongly inspired by experiencor’s keras-yolo3 projec t for performing the YOLO v3 model using Keras. Throughout this whole implementation, I am going to run this on Google Colab. Besides, we are going to using these cute dogs image for object detection.

YOLO v3 Object Detection with Keras

Photo by Alvan Nee on Unsplash

So let’s get our hand dirty!!

Step 1:

Jump into the very first step, the following are the necessary libraries and dependencies.

Step 2:

Next, the WeightReader class is used to parse the “yolov3. weights” file and load the model weights into memory.

Step 3:

YOLO v3 is using a new network to perform feature extraction which is undeniably larger compare to YOLO v2. This network is known as Darknet-53 as the whole network composes of 53 convolutional layers with shortcut connections (Redmon & Farhadi, 2018) .

YOLO v3 Object Detection with Keras

YOLO v3 network has 53 convolutional layers (Redmon & Farhadi, 2018)

Therefore, the code below composes several components which are:

  • _conv_block function which is used to construct a convolutional layer
  • make_yolov3_model function which is used to create layers of convolutional and stack together as a whole.

Step 4:

Next, the following code is explained as below:

save

Step 4:

This step involves decoding the prediction output into bounding boxes

The output of the YOLO v3 prediction is in the form of a list of arrays that hardly to be interpreted. As YOLO v3 is a multi-scale detection, it is decoded into three different scales in the shape of (13, 13, 225), (26, 26, 225), and (52, 52, 225)

YOLO v3 Object Detection with Keras

A slice of YOLOv3 prediction output before it gets decoded
YOLO v3 Object Detection with Keras
  • decode_netout function is used to decode the prediction output into boxes

In a nutshell, this is how the decode_netout function work as illustrated below:


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

疯狂科学家大本营

疯狂科学家大本营

Bei Er Fei Ao Er / 本书翻译组 译、黄晓庆 周宇煜 张为民 审译 / Science Press / 2012-1-5 / 48.00元

美国最棒的创意工场不是贝尔实验室,不是硅谷,也不是麻省理工学院的媒体实验室,而是由五角大楼领导的绝密军事机构DARPA——国防高级研究计划局。DARPA是由美国前总统艾森豪威尔建立的军事部门,创建的目的是为了回应苏联的太空计划。 虽然DARPA属于政府机构,但是没有冷冰 冰的氛围和官僚做派,那里的科学家偏爱牛仔裤和运动鞋。不过他们最爱的还是在各个领域寻找颠覆性创意。从航空航天、IT,到能源领......一起来看看 《疯狂科学家大本营》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

随机密码生成器
随机密码生成器

多种字符组合密码

html转js在线工具
html转js在线工具

html转js在线工具