What is the class of this image ?

主要是以下常见的数据集,用以衡量算法的分类准确率:

  • mnist、cifar-10、cifar-100stl-10
  • svhn、ILSVRC2012 task 1

1. cifar-10

CIFAR-10 and CIFAR-100 datasets

  • cifar-10-batches-py(Python 接口)

    import os
    import pickle
    import numpy as np def load_CIFAR10_batch(filename):
    with open(filename, 'rb') as f:
    data = pickle.load(f, encoding='latin1')
    X = data['data']
    y = data['labels']
    X = X.reshape(-1, 3, 32, 32).transpose(0, 2, 3, 1).astype(np.float32)
    y = np.array(y)
    return X, y def load_CIFAR10(root):
    xs, ys = [], []
    for n in range(1, 6):
    filename = os.path.join(root, 'data_batch_{}'.format(n))
    X, y = load_CIFAR10_batch(filename)
    xs.append(X)
    ys.append(y)
    Xtr = np.concatenate(xs)
    Ytr = np.concatenate(ys)
    Xte, Yte = load_CIFAR10_batch(os.path.join(root, 'test_batch'))
    return Xtr, Ytr, Xte, Yte

    对于描述数据信息的信息(batches.meta),仍然可以使用 pickle.load 的形式加载,加载的结果仍然是一个字典类型:

    with open('batches.meta', 'rb') as f:
    data = pickle.load(f, encoding='latin1')
    print(data) {'label_names': ['airplane',
    'automobile',
    'bird',
    'cat',
    'deer',
    'dog',
    'frog',
    'horse',
    'ship',
    'truck'],
    'num_cases_per_batch': 10000,
    'num_vis': 3072}
  • cifar-10-batches-mat(matlab 接口)

    最方便的方式是调用 matlab 内置已封装好的 api,helperCIFAR10Data.download/load,或者使用 edit helperCIFAR10Data查看其实现;

    function [train_x, train_y, test_x, test_y] = load_cifar(filepath)
    
        train_x = []; train_y = [];
    for i = 1:5
    filename = fullfile(filepath, sprintf('data_batch_%d.mat', i));
    [batch_train, batch_labels] = load_batch_as_4d_tensor(filename, true);
    train_x = cat(4, train_x, batch_train);
    train_y = [train_y; batch_labels];
    end
    filename = fullfile(filepath, 'test_batch.mat');
    [test_x, test_y] = load_batch_as_4d_tensor(filename, true);
    end function [train_x, train_y] = load_batch_as_4d_tensor(filename, to_categorical)
    % 这里的 x_train 是 4 维的 tensor, 32*32*3*num
    if ~exist('to_categorical', 'var') || isempty(to_categorical)
    to_categorical = false;
    end
    load(filename);
    train_x = reshape(data', 32, 32, 3, []);
    train_x = permute(train_x, [2, 1, 3, 4]); % 互换第一维和第二维
    train_y = labels;
    if to_categorical
    metafile = fullfile(fileparts(filename), 'batches.meta.mat');
    load(metafile);
    train_y = categorical(train_y, 0:9, label_names);
    end end

数据集(benchmark)、常用数据集的解析(cifar-10、)的更多相关文章

  1. 深度学习常用数据集 API(包括 Fashion MNIST)

    基准数据集 深度学习中经常会使用一些基准数据集进行一些测试.其中 MNIST, Cifar 10, cifar100, Fashion-MNIST 数据集常常被人们拿来当作练手的数据集.为了方便,诸如 ...

  2. RDD(弹性分布式数据集)及常用算子

    RDD(弹性分布式数据集)及常用算子 RDD(Resilient Distributed Dataset)叫做弹性分布式数据集,是 Spark 中最基本的数据 处理模型.代码中是一个抽象类,它代表一个 ...

  3. 【AO笔记】有关TIN数据集的常用介绍

    写论文查了很多TIN的接口和属性,特此来记录一下. 转载请注明出处:博客园@秋意正寒,B站同名. 未完待续 1. Tin数据集在ArcGIS中的描述 Tin数据集在磁盘中,被ArcGIS以文件夹形式管 ...

  4. 【转帖】Linux上,最常用的一批命令解析(10年精选)

    Linux上,最常用的一批命令解析(10年精选) https://juejin.im/post/5d134fbfe51d4510727c80d1 写的挺好呢 Linux这么多命令,通常会让初学者望而生 ...

  5. torchvision的理解和学习 加载常用数据集,对主流模型的调用.md

    torchvision的理解和学习 加载常用数据集,对主流模型的调用 https://blog.csdn.net/tsq292978891/article/details/79403617 加载常用数 ...

  6. 【神经网络与深度学习】基于Windows+Caffe的Minst和CIFAR—10训练过程说明

    Minst训练 我的路径:G:\Caffe\Caffe For Windows\examples\mnist  对于新手来说,初步完成环境的配置后,一脸茫然.不知如何跑Demo,有么有!那么接下来的教 ...

  7. 【翻译】TensorFlow卷积神经网络识别CIFAR 10Convolutional Neural Network (CNN)| CIFAR 10 TensorFlow

    原网址:https://data-flair.training/blogs/cnn-tensorflow-cifar-10/ by DataFlair Team · Published May 21, ...

  8. 人工智能大数据,公开的海量数据集下载,ImageNet数据集下载,数据挖掘机器学习数据集下载

    人工智能大数据,公开的海量数据集下载,ImageNet数据集下载,数据挖掘机器学习数据集下载 ImageNet挑战赛中超越人类的计算机视觉系统微软亚洲研究院视觉计算组基于深度卷积神经网络(CNN)的计 ...

  9. 机器学习数据集,主数据集不能通过,人脸数据集介绍,从r包中获取数据集,中国河流数据集

    机器学习数据集,主数据集不能通过,人脸数据集介绍,从r包中获取数据集,中国河流数据集   选自Microsoft www.tz365.Cn 作者:Lee Scott 机器之心编译 参与:李亚洲.吴攀. ...

  10. xml常用四种解析方式优缺点的分析×××××

    xml常用四种解析方式优缺点的分析 博客分类: xml   最近用得到xml的解析方式,于是就翻了翻自己的笔记同时从网上查找了资料,自己在前人的基础上总结了下,贴出来大家分享下. 首先介绍一下xml语 ...

随机推荐

  1. 学习easyui疑问(三)

    今天我学习easyui中碰到的还有一问题是:怎样创建一个表格? 首先,在easyui中文官网上提供的这样一种定义方式: <!--table--> <table id="tt ...

  2. [D3] Create Chart Axes with D3 v4

    Most charts aren’t complete without axes to provide context and labeling for the graphical elements ...

  3. [Angular] AuthService and AngularFire integration

    Config AngularFire, we need database and auth module from firebase. import {NgModule} from '@angular ...

  4. angular 引入material-ui

    第一步:安装material和cdk和animations,一个也不能缺,否则会报错. npm install --save @angular/material @angular/cdk @angul ...

  5. 【例题 6-3 UVA - 442】Matrix Chain Multiplication

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 用栈来处理一下表达式就好. 因为括号是一定匹配的.所以简单很多. ab x bc会做abc次乘法. [代码] #include< ...

  6. 24、vb2_buffer和videobuf_buffer比较分析

    看韦东山视频第三期摄像头驱动中构造了自己的vivi驱动,但是使用的videoBuf结构体,新的版本用的是vb2_buffer结构,我机器上(ubuntu12.04)使用的内核是linux3.2,看了看 ...

  7. embed-it_Integrator memory compile工具使用之二

    embed-it_Integrator memory compile工具使用之二 主要内容 使用ish接口自动加载memory的cfg文件运行生成memory 脚本内容 打开Integrate &am ...

  8. kernel build &amp; preempt-rt patch &amp; xenomai

    提前准备好 linux 内核源代码,假设是 x86 系统.能够去下载原生内核(Vanilla kernel): wget https://www.kernel.org/pub/linux/kernel ...

  9. C#验证手机号

    using System.Text.RegularExpressions; private bool IsMobile(string phoneNo) { return Regex.IsMatch(p ...

  10. ios开发事件处理之:一:UIView的拖拽

    1.ios当中常⽤的事件?  触摸事件 ,加速计事件 ,远程控制事件 2.什么是响应者对象? 继承了UIResponds的对象我们称它为响应者对象 UIApplication.UIViewContro ...