def __init__(self, imRoot, normalRoot, depthRoot, segRoot, imHeight=480, imWidth=640, imWidthMax=600, imWidthMin=560, phase='TRAIN', rseed=None):
    self.imRoot = imRoot
    self.imHeight = imHeight
    self.imWidth = imWidth
    self.phase = phase.upper()
    self.imWidthMax = imWidthMax
    self.imWidthMin = imWidthMin
    if (phase == 'TRAIN'):
        with open('NYUTrain.txt', 'r') as fIn:
            imList = fIn.readlines()
        self.imList = [osp.join(self.imRoot, x.strip()) for x in imList]
    elif (phase == 'TEST'):
        with open('NYUTest.txt', 'r') as fIn:
            imList = fIn.readlines()
        self.imList = [osp.join(self.imRoot, x.strip()) for x in imList]
    self.normalList = [x.replace(imRoot, normalRoot) for x in self.imList]
    self.segList = [x.replace(imRoot, segRoot) for x in self.imList]
    self.depthList = [x.replace(imRoot, depthRoot).replace('.png', '.tiff') for x in self.imList]
    print(('Image Num: %d' % len(self.imList)))
    self.count = len(self.imList)
    self.perm = list(range(self.count))
    if (rseed is not None):
        random.seed(0)
    random.shuffle(self.perm)
def __init__(self, imRoot, normalRoot, depthRoot, segRoot, imHeight=480, imWidth=640, imWidthMax=600, imWidthMin=560, phase='TRAIN', rseed=None):
    self.imRoot = imRoot
    self.imHeight = imHeight
    self.imWidth = imWidth
    self.phase = phase.upper()
    self.imWidthMax = imWidthMax
    self.imWidthMin = imWidthMin
    if (phase == 'TRAIN'):
        with open('NYUTrain.txt', 'r') as fIn:
            imList = fIn.readlines()
        self.imList = [osp.join(self.imRoot, x.strip()) for x in imList]
    elif (phase == 'TEST'):
        with open('NYUTest.txt', 'r') as fIn:
            imList = fIn.readlines()
        self.imList = [osp.join(self.imRoot, x.strip()) for x in imList]
    self.normalList = [x.replace(imRoot, normalRoot) for x in self.imList]
    self.segList = [x.replace(imRoot, segRoot) for x in self.imList]
    self.depthList = [x.replace(imRoot, depthRoot).replace('.png', '.tiff') for x in self.imList]
    print(('Image Num: %d' % len(self.imList)))
    self.count = len(self.imList)
    self.perm = list(range(self.count))
    if (rseed is not None):
        random.seed(0)
    random.shuffle(self.perm)