目标检测数据集分析

原文链接:https://ghlcode.cn/pages/250d97

目标检测数据集分析

📢 新增支持数据集可视化,Ghlerrix/DataAnalyze

平时我们经常需要对我们的数据集进行各种分析,以便我们找到更好的提高方式。所以我将我平时分析数据集的一些方法打包发布在了Github上,分享给大家,有什么错误和意见,请多多指教!

项目地址

https://github.com/Ghlerrix/DataAnalyze

图片数量、标注框数量、类别信息

这些信息会在终端打印出来,格式如下:

Parsing dataset, please wait...
Parsing done. (0.013s)

number of images: 1266
number of annotations: 2950
number of categories: 6
names of categories:  ['inclusion', 'rolled-in_scale', 'pitted_surface', 'patches', 'crazing', 'scratches']

所有图片宽度和高度的散点图

这里只有一个点,是因为所有的图片尺寸相同

https://fastly.jsdelivr.net/gh/Ghlerrix/ImageHosting/img/image-20230724135917043.png

所有标注框宽度和高度的散点图

https://fastly.jsdelivr.net/gh/Ghlerrix/ImageHosting/img/image-20230724135938272.png

标注框宽度和高度之比 横坐标为比率,纵坐标为数量

https://fastly.jsdelivr.net/gh/Ghlerrix/ImageHosting/img/image-20230724142948691.png

每一类的标注框数量

https://fastly.jsdelivr.net/gh/Ghlerrix/ImageHosting/img/image-20230724133028407.png

https://fastly.jsdelivr.net/gh/Ghlerrix/ImageHosting/img/image-20230724133043677.png

每一类图片数量

https://fastly.jsdelivr.net/gh/Ghlerrix/ImageHosting/img/image-20230724133120693.png

https://fastly.jsdelivr.net/gh/Ghlerrix/ImageHosting/img/image-20230724133238728.png

每一张图片上的标注框数量

横坐标为一张图片上的标注框数量,纵坐标为图片数量

https://fastly.jsdelivr.net/gh/Ghlerrix/ImageHosting/img/image-20230724133318433.png

不同尺寸的图片数量

根据coco的划分规则计算

https://fastly.jsdelivr.net/gh/Ghlerrix/ImageHosting/img/image-20230724140109094.png

https://fastly.jsdelivr.net/gh/Ghlerrix/ImageHosting/img/image-20230724140052480.png

使用方法

Ghlerrix/DataAnalyze: Object-detection dataset analyze (github.com)

Install

git clone https://github.com/Ghlerrix/DataAnalyze.gitcd DataAnalyzepip install -r requirements.txt

Usage

python analyze.py ${type} ${path} [--out ${out}]
  • type The format of the dataset, optional ‘coco’ or ‘voc’.
  • path The path of dataset. If type is ‘coco’, the path is the json file path. If type is ‘voc’, the path is the path of the xml file directory.
  • -out is the output directory, default is ‘./out’

Example

python analyze.py coco ./tarin.json --out ./out/
python analyze.py voc ./xml/ --out ./out/
评论 27
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值