datadings是为机器学习准备数据集的工具集。它易于使用,节省空间,速度极快。
datadings的Python项目详细描述
datadings是为机器准备数据集的工具集合 学习,基于两个简单的原则
Datasets are collections of individual data samples.
Each sample is a dictionary with descriptive keys.
对于带图像的监督培训,字典示例如下:
{"key": unique_key, "image": imagedata, "label": label}
msgpack被用作有效的存储 大多数支持的数据集的格式。在
支持的数据集
Dataset | Short Description |
---|---|
ADE20k | Scene Parsing, Segmentation |
ANP460 | own Eye-Tracking dataset (Jalpa) |
CAMVID | Motion-based Segmentation |
CAT2000 | MIT Saliency |
CIFAR | 32x32 color image classification with 10/100 classes |
Cityscapes | Segmentation, Semantic understanding of urban street scenes |
Coutrot1 | Eye-Tracking, Saliency |
FIGRIMFixation | Eye-Tracking, Saliency |
ILSVRC2012 | Imagenet Large Scale Visual Recognition Challenge |
InriaBuildings | Inria Areal Image Labeling Dataset (Buildings), Segmentation, Remote Sensing |
MIT1003 | Eye-Tracking, Saliency, Learning to predict where humans look |
MIT300 | Eye-Tracking, Saliency |
Places2017 | MIT Places, Scene Recognition |
Places365 | MIT Places365, Scene Recognition |
RIT18 | High-Res Multispectral Semantic Segmentation, Remote Sensing |
SALICON2015 | Saliency in Context, Eye-Tracking |
SALICON2017 | Saliency in Context, Eye-Tracking |
VOC2012 | Pascal Visual Object Classes Challenge |
Vaihingen | Remote Sensing, Semantic Object Classification, Segmentation |
YFCC100m | Yahoo Flickr Creative Commons 100 M pics |
命令行工具
- datadings write 创建新的数据集文件。在
- datadings目录 打印数据集文件的(缩写)内容。在
- datadings shuffle 无序处理现有的数据集文件。在
- datadings合并 合并两个或多个数据集文件。在
- datadings split 将数据集文件拆分为两个或多个子集。在
- datadings工作台 运行一些基本的读性能基准测试。在
基本用途
每个数据集都定义了要在 datadings.sets包。 对于大多数数据集,读取模块只包含额外的 像类标签和分发的元数据。在
让我们以MIT1003数据集为例。在
MIT1003_write是创建数据集文件的可执行文件。 它可以直接调用,也可以通过datadings write调用。 将写入三个文件:
- MIT1003.msgpack包含示例数据
- MIT1003.msgpack.index包含随机访问的索引
- MIT1003.msgpack.md5包含两个文件的MD5哈希值
按顺序读取所有样本, 使用MsgpackReader作为上下文管理器:
^{pr2}$这个标准迭代器返回字典。 使用rawiter()方法获取messagepack编码的示例 字节。在
阅读特定样本:
reader.seek_key('i14020903.jpeg') print(reader.next()['key']) reader.seek_index(100) print(reader.next()['key'])
以原始字节形式读取示例:
raw = reader.rawnext() for raw in reader.rawiter(): print(type(raw), len(raw))
样本数量:
print(len(reader))
您还可以更改迭代样本的顺序和选择 用增援。 例如,要随机化样本顺序,请包装阅读器 在Shuffler中:
from datadings.reader import Shuffler with Shuffler(MsgpackReader('MIT1003.msgpack')) as reader: for sample in reader: # do dataset things, but in random order!
一个常见的用例是对整个数据集进行多次迭代。 这可以用Cycler完成:
from datadings.reader import Cycler with Cycler(MsgpackReader('MIT1003.msgpack')) as reader: for sample in reader: # do dataset things, but FOREVER!
- 项目
标签: