在corel 5k数据集中,图像标签存储形式为mat格式,可是电脑上没有装matlab,所以利用python进行读取,再转成自己需要的格式。
以corel5k_test_annot.mat
为例
1 | import scipy.io as sio |
其中,data里的格式为:1
2
3
4
5
6
7
8
9
10
11
12{
'__header__': b'MATLAB 5.0 MAT-file, Platform: PCWIN, Created on: Fri Oct 25 22:30:59 2013',
'__version__': '1.0',
'annot2': array([[0, 1, 1, ..., 0, 0, 0],
[0, 0, 1, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
...,
[0, 0, 1, ..., 0, 0, 0],
[0, 0, 1, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0]], dtype=uint16),
'__globals__': []
}