hukaixuan19970627 / yolov5_obb

yolov5 + csl_label.(Oriented Object Detection)(Rotation Detection)(Rotated BBox)基于yolov5的旋转目标检测
GNU General Public License v3.0
1.81k stars 425 forks source link

train_batch0/1/2中发现检测框发生偏移 #103

Closed isLucas closed 2 years ago

isLucas commented 2 years ago

❔Question

大佬您好,我在训练自己训练集的时候发现检测框发生偏移了,请问这可能是哪些原因造成的呢?我猜想可能是因为我的图片尺寸不一致?我用您的转yolo格式工具转格式之后,在draw文件夹里检测框是没有发生偏移的。 如果大佬看到issue,有空的话请您帮我解答一下,谢谢您,这对我很重要! P.S.:我尝试过把mosaic关闭,发现还是会发生偏移。我的数据集是单分类,按照您的帖子把nc改成了2进行训练。

train_batch1 train_batch2 train_batch1

github-actions[bot] commented 2 years ago

Hello @isLucas, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook Open In Colab, Docker Image, and Google Cloud Quickstart Guide for example environments.

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom model or data training question, please note Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:

For more information please visit https://www.ultralytics.com.

hukaixuan19970627 commented 2 years ago

看起来似乎就是label标注的时候没贴合物体形状本身,所以求取最小外接矩形时计算得到的旋转角度有偏差。 你确定Draw里所有的图像(而不是一部分)都没问题吗,train_batch实际上就是把数据增强后的图像可视化出来而已。

isLucas commented 2 years ago

看起来似乎就是label标注的时候没贴合物体形状本身,所以求取最小外接矩形时计算得到的旋转角度有偏差。 你确定Draw里所有的图像(而不是一部分)都没问题吗,train_batch实际上就是把数据增强后的图像可视化出来而已。

大佬您好!谢谢您抽空回复我了。我又检查了一遍draw的数据,确定所有的图像都是贴合检测框的,不过有一些框似乎变形成平行四边形了 (如下图) 。会不会是在图像增强之后出错的,我去尝试把图像增强关掉之后效果如何。 078_

isLucas commented 2 years ago

我的数据集是用roLabelImg标注之后,转成dota格式再用您的代码转成yolo的

isLucas commented 2 years ago

大佬您好,又是我...我又双叒叕看了一遍您的知乎文章,按照评论所说的把图片高、宽统一之后再转换成yolo格式,并且把mosaic也关了,看train_batch0/1/2的情况,目前框的问题应该是解决了,如下图。 但是现在遇到了一个新的问题,我在predict的时候,即使predict训练集,也没有检测出半个物体,我按评论说的把检测的图片都resize成640 * 640 (没有变形) 之后也没用。我想请问下这会是什么原因呢?我使用的是Yolov5l的预训练权重。看result.png中的total loss,感觉应该不至于一个都检测不出来。。希望大佬看到的时候能帮我解答一下,十分感谢! train_batch0 results

hukaixuan19970627 commented 2 years ago

降低置信度的阈值看看,不至于一个都检测不出来的

hy2021022213 commented 2 years ago

我的数据集是用roLabelImg标注之后,转成dota格式再用您的代码转成yolo的

你好,我也这里出现了问题,如果方便的话,可以把解决方案告知一下我吗?

hukaixuan19970627 commented 2 years ago

有解决吗,我先关闭这个issue,如果还未解决的话可以reopen