与opencv yolo

Multiple object detection

多目标检测

Today we will look at how we can use YOLO in OpenCV framework.YOLO first came out in 2016, which is used for multiple object detection. Its compatible with OpenCV framework but we need to download “yolov3.weights” and also “yolov3.cfg”. I have uploaded these file along with the code on my github repo.

今天,我们将探讨如何在OpenCV框架中使用YOLO.YOLO于2016年首次问世,用于多目标检测。 它与OpenCV框架兼容,但我们需要下载“ yolov3.weights”和“ yolov3.cfg”。 我已经将这些文件以及代码上传到我的github存储库中。

Lets go through the code now, its fairly simple.So the first step would be to import the model and read “coco.names” which contains the image labels and get the output layer.

现在让我们来看一下它的代码,它非常简单。因此第一步是导入模型并读取包含图像标签的“ coco.names”并获取输出层。

Image for post

Next thing would be to read the input image, and create blob to extract the features from the input image. The input dimension of the image was 416*416 and (0,0,0) signifies the color space of the image.

下一步是读取输入图像,并创建Blob以从输入图像中提取特征。 图像的输入尺寸为416 * 416,并且(0,0,0)表示图像的色彩空间。

Image for post

We will loop through the blob and find out the objects which has been detected. But before that we have to feed blob to the yolo algorithm and extract its features from the output layer. We can relate it to a CNN model.Also we are interested in object with more than 50% confidence prediction.

我们将遍历该blob并找出已检测到的对象。 但是在此之前,我们必须将blob馈给yolo算法并从输出层提取其特征。 我们可以将其与CNN模型相关联。此外,我们对具有50%以上置信度预测的对象也很感兴趣。

Image for post

The challenge is to separate out the redundant object which the algorithm detects. Finally we can create a bounding box and display the image.

挑战在于分离算法检测到的冗余对象。 最后,我们可以创建一个边界框并显示图像。

Image for post

I hope the article was useful to understand how we can use YOLO in OpenCV framework. You can get the code and the necessary files on my git account.

我希望本文对理解我们如何在OpenCV框架中使用YOLO有所帮助。 您可以在我的git帐户上获取代码和必要的文件。

Thanks for reading!

谢谢阅读!

翻译自: https://medium.com/@ishanmazumderedu/yolo-with-opencv-7f0a4e5c05cb

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值