datasets
BJRSR
这个作者很懒,什么都没留下…
展开
-
cifar10 cifar100 svhn 数据抽取
cifar10 import os import _pickle as cPickle import numpy as np def load_cifar10(data_dir='../data/'): def load_cifar_batches(filenames): if isinstance(filenames, str): filenames = [filenames] images = [] labels = .原创 2021-04-20 10:18:11 · 345 阅读 · 1 评论 -
判断是否为图像文件
def is_image_file(fileName): ls = [fileName.endswith(extension) for extension in ['.jpg', '.png', '.jpeg']] print(ls) print(any(ls)) fileName = '01.jpg' is_image_file(fileName)原创 2021-03-30 09:41:35 · 549 阅读 · 0 评论 -
BSD500数据集下载和处理
首先,用urllib获取数据,写个压缩包文件,把数据存进去,解压压缩包文件,形成带有数据的目录。 from os.path import exists, basename, join from os import makedirs, remove from six.moves import urllib import tarfile class download_basd300(object): def __init__(self, dest="dataset"): sel.原创 2021-03-30 09:23:56 · 1752 阅读 · 1 评论 -
BSD500数据集处理
from os.path import exists, join, basename from os import makedirs, remove from six.moves import urllib import tarfile from torchvision.transforms import Compose, CenterCrop, ToTensor, Resize from dataset import DatasetFromFolder def download_bsd300(de.原创 2021-03-30 09:03:20 · 776 阅读 · 0 评论