Comments (4)
确实有这个问题,不过我暂时也不清楚如何解决。
我先是利用cv2.minAreaRect()函数将 [x1 y1 x2 y2 x3 y3 x4 y4 ] 任意四边形的格式转为最小外接矩形 [x y w h θ] 格式,再接着转为[x y longside shortside θ] 长边表示法。
为了验证格式转换正确,绘制YOLO格式的旋转矩形框时,会将[x y longside shortside θ]格式转回[x y w h θ]格式,再利用cv2.boxPoints()函数返回最小外接旋转矩形的四个点,并绘制出来。
中间过程坐标数据可能会产生些许变化,由于大部分代码我都是调用的cv库,所以暂时也不知道是哪一个步骤出了问题;
但detect的结果图却显示正常(detect的可视化就是将长边表示法转为opencv表示法,再求得四点坐标进行绘制),所以问题可能发生在cv2.minAreaRect()这个函数中。
可能的解决办法就是改变opencv的版本吧,但是opencv升级的话又可能带来新的问题(θ的定义范围改变),我嫌麻烦就没改,因为根据我自己的测试结果来看,这点差异在DOTA数据集上没有多大影响
from dota_devkit_yolo.
确实有这个问题,不过我暂时也不清楚如何解决。
我先是利用cv2.minAreaRect()函数将 [x1 y1 x2 y2 x3 y3 x4 y4 ] 任意四边形的格式转为最小外接矩形 [x y w h θ] 格式,再接着转为[x y longside shortside θ] 长边表示法。
为了验证格式转换正确,绘制YOLO格式的旋转矩形框时,会将[x y longside shortside θ]格式转回[x y w h θ]格式,再利用cv2.boxPoints()函数返回最小外接旋转矩形的四个点,并绘制出来。
中间过程坐标数据可能会产生些许变化,由于大部分代码我都是调用的cv库,所以暂时也不知道是哪一个步骤出了问题;
但detect的结果图却显示正常(detect的可视化就是将长边表示法转为opencv表示法,再求得四点坐标进行绘制),所以问题可能发生在cv2.minAreaRect()这个函数中。
可能的解决办法就是改变opencv的版本吧,但是opencv升级的话又可能带来新的问题(θ的定义范围改变),我嫌麻烦就没改,因为根据我自己的测试结果来看,这点差异在DOTA数据集上没有多大影响
感谢回复。
Before you put x1 y1 x2 y2 x3 y3 x4 y4 into cv2.minAreaRect(), you did NORMALIZATION with them. I haven't met the operation before neither seen it in any instance online. Maybe errors came from this. I'll try to train first and see what will happend.
Thanks.
from dota_devkit_yolo.
https://zhuanlan.zhihu.com/p/385701722
可以试试这个
from dota_devkit_yolo.
https://github.com/hukaixuan19970627/yolov5_obb
我更新了一版代码,重构了一遍yolo预处理的逻辑,这个问题以后不会再出现了。
不过DOTA_devkit_YOLO这个repo也就没啥用了,poly与rbox之间的转换由内部代码自动完成
from dota_devkit_yolo.
Related Issues (20)
- ImgSplit.py和ImgSplit_multi_process.py的区别 HOT 2
- Error running the training file;Multi-distributed training HOT 1
- 切割问题
- 变量命名问题
- ResultMerge HOT 1
- 运行ImgSplit_multi_process.py分割图片时出现SyntaxError: 'gbk' codec can't decode byte 0xbd in position 1695: illegal multibyte sequence
- 请问DOTA_devkit_YOLO-master/ResultMerge_example/1.txt这个标签里的第二个数字代表什么? HOT 2
- opencv表示法的范围 HOT 1
- 关于融合后生成标签文件的问题
- resultMerge合并HBB
- 精度和召回率计算
- YOLO_Transform转换过程中解决出现图片占用问题(windows系统下) HOT 1
- 为什么切割后 有好多是不是1024*1024的 好多比较小的
- θ计算出现异常,当前数据为:0.3331432342529297, 0.4323351383209229, 0.1747053265571594, 0.7604488134384155, 25.6;超出opencv表示法的范围:[-90,0) HOT 1
- 运行ResultMerge.py 报错ModuleNotFoundError: No module named '_polyiou'
- 如何在DOTA官网提交zip测评文件
- 图像数据归一化的问题 HOT 1
- A problem about data prepare HOT 2
- 对label进行转换 HOT 1
- Loss 降不下去 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dota_devkit_yolo.