def _get_dataset(self): dic = {} dic["file_path"] = "%s" % self.hyper["file_path"] dic["label_size"] = 1 dic["class_nums"] = 10 if self.hyper["dataset"] == "mnist": dic["img_size"] = 28 * 28 dataset = mnist_dataset.MnistSet(dic) if self.hyper["dataset"] == "cifar10": dic["img_size"] = 32 * 32 * 3 dataset = cifar10_dataset.Cifar10Set(dic) return dataset
def test_cifar10_test_set(): dic = get_cifar10_dic() batch_size = 100 dataset = cifar10_dataset.Cifar10Set(dic) data_generator = dataset.get_test_data_generator(batch_size) count = 1 while True: batch_img, batch_labels, status = dataset.get_a_batch_data( data_generator) print("count:%s status:%s " % (count, status)) if not status: break count += 1
def test_cifar10_test_set(): file_path = "./data/" batch_size = 100 dataset = cifar10_dataset.Cifar10Set(file_path) data_generator = dataset.get_test_data_generator(batch_size) count = 1 while True: batch_img, batch_labels, status = dataset.get_a_batch_data(data_generator) print("count:%s status:%s " % (count, status)) if not status: break count += 1 print(str(batch_labels))
def _get_dataset(self): dataset = cifar10_dataset.Cifar10Set(self.hyper["file_path"]) return dataset
def test_generator_cifar10_train_images(): dic = get_cifar10_dic() train_img_path = "./cifar10_img/train/" dataset = cifar10_dataset.Cifar10Set(dic) dataset.generator_train_images(train_img_path)
def test_generator_test_images(): file_path = "./data/" test_img_path = "./img/test/" dataset = cifar10_dataset.Cifar10Set(file_path) dataset.generator_test_images(test_img_path)