图像数据集eda工具,用于检查图像的基本信息。
basic-image-eda的Python项目详细描述
基本图像eda
一个简单的多处理EDA工具,用于检查目录下图像的基本信息(图像以递归方式找到)。这个工具是为了快速检查信息,防止在读取、调整大小和规范化图像作为神经网络的输入时出错。它可以用于第一次参加图像比赛或用图像训练CNN!在
备注:
-所有图像都将转换为3通道(rgb)图像。当具有不同通道的图像混合时,某些结果可能会产生误导。
-支持uint8和uint16数据类型。如果不同的数据类型混合在一起,则会发生错误。
-支持的扩展:jpg、jpeg、jpe、png、tif、tiff、bmp、ppm、pbm、pgm、sr、ras、webp
安装
pip install basic-image-eda
或(最新版本)
^{pr2}$先决条件:
- opencv python
- numpy公司
- matplotlib库
- 在略读.io在
- TIFF文件
- 全面质量管理
用法(CLI/代码)
CLI
简单的一行命令!在
basic-image-eda <data_dir>
或者
basic-image-eda <data_dir> -e png tiff -t 12 --dimension_plot --channel_hist --nonzero --hw_division_factor 2.0 > eda.txt Options: -e --extensions target image extensions. if none, all supported extensions are included.(default=None) -t --threads number of multiprocessing threads. if0, automatically count max threads.(default=0) -d --dimension_plot show dimension(height/width) scatter plot.(default=False) -c --channel_hist show channelwise pixel value histogram. takes longer time.(default=False) -n --nonzero calculate values only from non-zero pixels of the images.(default=False) -f --hw_division_factor divide height,width of the images by this factor to make pixel value calculation faster. Information on height, width are not changed and will be printed correctly.(default=1.0) -V --version show version.
代码
frombasic_image_edaimportBasicImageEDAif__name__=="__main__":# for multiprocessingdata_dir="./data"BasicImageEDA.explore(data_dir)# orextensions=['png','jpg','jpeg']threads=0dimension_plot=Truechannel_hist=Truenonzero=Falsehw_division_factor=1.0BasicImageEDA.explore(data_dir,extensions,threads,dimension_plot,channel_hist,nonzero,hw_division_factor)
结果
关于celeba dataset(测试集)的结果
found 19962 images.
Using 12 threads. (max:12)
*--------------------------------------------------------------------------------------*
number of images | 19962
dtype | uint8
channels | [3]
extensions | ['jpg']
min height | 85
max height | 5616
mean height | 591.8215108706543
median height | 500
min width | 85
max width | 5616
mean width | 490.2976655645727
median width | 396
mean height/width ratio | 1.207065732587525
median height/width ratio | 1.2626262626262625
recommended input size(by mean) | [592 488] (h x w, multiples of 8)
recommended input size(by mean) | [592 496] (h x w, multiples of 16)
recommended input size(by mean) | [576 480] (h x w, multiples of 32)
channel mean(0~1) | [0.4954518 0.42574266 0.39330518]
channel std(0~1) | [0.3216056 0.3023355 0.3018837]
*--------------------------------------------------------------------------------------*
下载站点:http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html
论文:S.Yang,P.Luo,C.C.Loy,和X.Tang,“从面部零件响应到人脸检测:一种深度学习方法”,在IEEE国际计算机视觉会议(ICCV)上,2015年
关于NIH Chest X-ray dataset的结果(图片001。焦油gz)
found 4999 images.
Using 12 threads. (max:12)
*--------------------------------------------------------------------------------------*
number of images | 4999
dtype | uint8
channels | [1, 4]
extensions | ['png']
min height | 1024
max height | 1024
mean height | 1024.0
median height | 1024
min width | 1024
max width | 1024
mean width | 1024.0
median width | 1024
mean height/width ratio | 1.0
median height/width ratio | 1.0
recommended input size(by mean) | [1024 1024] (h x w, multiples of 8)
recommended input size(by mean) | [1024 1024] (h x w, multiples of 16)
recommended input size(by mean) | [1024 1024] (h x w, multiples of 32)
channel mean(0~1) | [0.5172472 0.5172472 0.5172472]
channel std(0~1) | [0.25274998 0.25274998 0.25274998]
*--------------------------------------------------------------------------------------*
数据提供者:NIH临床中心
下载站点:https://nihcc.app.box.com/v/ChestXray-NIHCC
论文:王晓松,彭一凡,卢乐,卢智勇,穆罕默德巴格里,罗纳德·萨默斯,胸部X光8:
医院级胸部X线数据库与弱监督分类定位基准
常见胸部疾病,IEEE CVPR,第3462-34712017页
许可证
- 项目
标签: