def __init__(self, label, classes=None, augmentation=None, preprocessing=None): self.gluoncv_dataset = CitySegmentation(split=label) self.images_fps = self.gluoncv_dataset.images self.masks_fps = self.gluoncv_dataset.mask_paths # convert str names to class values on masks self.class_values = [ self.CLASSES.index(cls.lower()) for cls in classes ] self.augmentation = augmentation self.preprocessing = preprocessing
import numpy as np import tensorflow as tf import keras from keras.models import Sequential from keras.layers import Conv2D, MaxPooling2D, ReLU, BatchNormalization, Softmax, UpSampling2D from gluoncv.data import CitySegmentation train_dataset = CitySegmentation(split='train') val_dataset = CitySegmentation(split='val') train_examples = len(train_dataset) val_examples = len(val_dataset) ##################### def model_add(model, layers): for l in layers: model.add(l) ##################### ''' x_train, y_train = zip(*train_dataset) x_val, y_val = zip(*val_dataset) ''' ''' count = 0 x_train = []; y_train = [] for (x, y) in train_dataset: print (count)
os.environ["CUDA_VISIBLE_DEVICES"] = "0" import numpy as np import mxnet as mx import tensorflow as tf import keras import queue import threading from gluoncv.data import CitySegmentation from lib.SegNet import SegNet #################################### train_dataset = CitySegmentation(split='train') train_examples = len(train_dataset) val_dataset = CitySegmentation(split='val') val_examples = len(val_dataset) batch_size = 5 epochs = 10 train_dataset_np = train_dataset.asnumpy() #################################### def fill_queue(d, q): ii = 0