from __future__ import print_function
import matplotlib.pyplot as pyplot
import PIL.Image as Image
import pickle
import numpy as np
import random
import os,re
def unpickle(file):
# data:a 10000x3072 numpy array of uint8s. Each row of the array stores a 32x32 colour image.
# The first 1024 entries contain the red channel values, the next 1024 the green,
# and the final 1024 the blue. The image is stored in row-major order,
# so that the first 32 entries of the array are the red channel values of the first row of the image.
# labels:a list of 10000 number
将当前目录下cifar-10-batches-py转换成train图片和test图片,并同时生成train.txt 和 test.txt
最新推荐文章于 2024-06-27 10:55:55 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)