问题描述
我正在尝试创建自己的数据集以用于YOLO(仅查看一次).最初,我从一个大型的geotiff文件开始,其中包含风景和动物的图片.我能够编写脚本将动物的图像提取到单独的文件中.
I'm attempting to create my own dataset for use with YOLO (You Only Look Once). Initially, I started with a large geotiff file that had pictures of landscape and animals. I was able to write a script to extract the images of the animals into separate files.
我现在要把那些动物图像用作YOLO数据集的一部分.但是,我在网上看到的所有示例都使用注释文件,这些文件表示在较大图像中要检测的对象的位置.
I'm now at a point where I'd like to use those animal images as part of a YOLO dataset. However, all of the examples I've seen online utilize annotation files, which denote the location of an object-to-be-detected within a larger image.
就我而言,每张动物图片的全部内容都将包含在边界框中.在这种情况下我该怎么办?
In my case, each animal picture in its entirety is what would be included within the bounding box. What can I do in this case?
我要问的是:我是否仍然可以使用这些已裁剪的图像,然后在注释文件中注意边界框应覆盖整个图像?
What I mean to ask is this: Is it still possible for me to use these already-cropped images, and then note on the annotation file that the bounding box should cover the entire image?
推荐答案
简单答案:否.在像Yolo这样的对象检测情况下,我们希望Yolo识别出哪个是对象,哪个是非对象.创建边界框时,Yolo会将边界框识别为属于1类的正对象,并且将边界框之外的零件识别为非对象.
Simple answer : No. In case of object detection like Yolo, we want Yolo to identify which is object and which is non-object. When you create bounding box, Yolo will identify the bounding box as a positive object that belong to 1 class, and the part outside the bounding box is identified as non-object.
该模型将尝试学习如何区分对象与不区分对象,以及如何根据训练数据注释在精确坐标(x,y,w,h)上绘制边界框.在这种情况下,Yolo使用锚定框概念,Yolo会将最近的锚定框的大小调整为预测对象的大小.
The model will try to learn how to distinguish between object and not, and how to draw the bounding box on exact coordinate (x,y,w,h) according to your training data annotation. In this case, Yolo uses anchor boxes concept, and Yolo will adjust the size of nearest anchor box to size of the predicted object.
创建自定义训练数据集时,您需要:带有边界框+边界框坐标的带注释的图像,该文本保存在文本文件中,例如:
When you create your custom training dataset, yolo need : annotated image with bounding box + bounding box coordinate that saved in text file, such as :
<object-class> <x_center> <y_center> <width> <height>
因此,您将需要这些信息来训练Yolo模型.
So you will need those information in order to train Yolo model.
通常,当您已经裁剪了数据集时,我认为它更适合于图像分类任务.或者,如果您能够创建将动物与大图像区分开的脚本,为什么不为相关图像自动创建边界框注释和yolo坐标训练文本文件?
Usually when you have already cropped dataset, I think it's more suitable for image classification task. Or if you were able to create script to distinguish animal from large image, why don't you automatically create bounding boxes annotation and yolo coordinate training text files for related images?
这篇关于已裁剪图像的YOLO批注文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!