Exemplo n.º 1
0
 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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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))
Exemplo n.º 4
0
 def _get_dataset(self):
     dataset = cifar10_dataset.Cifar10Set(self.hyper["file_path"])
     return dataset
Exemplo n.º 5
0
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)
Exemplo n.º 6
0
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)