cifar10 数据集介绍「建议收藏」(10数据集的简介)
生活随笔
收集整理的這篇文章主要介紹了
cifar10 数据集介绍「建议收藏」(10数据集的简介)
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
基本信息
CIFAR-10 是一個(gè)包含60000張圖片的數(shù)據(jù)集。其中每張照片為32*32的彩色照片,每個(gè)像素點(diǎn)包括RGB三個(gè)數(shù)值,數(shù)值范圍 0 ~ 255。所有照片分屬10個(gè)不同的類別,分別是 ‘airplane’, ‘automobile’, ‘bird’, ‘cat’, ‘deer’, ‘dog’, ‘frog’, ‘horse’, ‘ship’, ‘truck’。其中五萬(wàn)張圖片被劃分為訓(xùn)練集,剩下的一萬(wàn)張圖片屬于測(cè)試集。
下載數(shù)據(jù)集
打開下面的鏈接進(jìn)入官網(wǎng)下載
http://www.cs.toronto.edu/~kriz/cifar.html
查看文件
基于Python3.5
#python3
import numpy as np
import pickle
import os
CIFAR_DIR = "./cifar-10-batches-py"
print(os.listdir(CIFAR_DIR))
with open(os.path.join(CIFAR_DIR, "data_batch_1"), 'rb') as f:
data = pickle.load(f, encoding='bytes')
print(type(data))
print(data.keys())
print(type(data[b'data']))
print(type(data[b'labels']))
print(type(data[b'batch_label']))
print(type(data[b'filenames']))
print(data[b'data'].shape)
print(data[b'data'][2:4])
print(data[b'batch_label'])
print(data[b'filenames'][2:4])
image = data[b'data'][100]
image = image.reshape((3,32,32)) #32 32 3
image = image.transpose((1,2,0))
#matplotlib inline
import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow
imshow(image)
plt.show()
運(yùn)行結(jié)果如下:
總結(jié)
以上是生活随笔為你收集整理的cifar10 数据集介绍「建议收藏」(10数据集的简介)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: SAP Fiori Elements L
- 下一篇: 如何查看 SAP Fiori Eleme