def train_test_splitter(images, labels):
    dataset = [(image, label) for (image, label) in zip(images, labels)]
    dataset_size = len(dataset)
    trainset_size = int((0.8 * dataset_size))
    testset_size = (dataset_size - trainset_size)
    logger.debug('Dataset size: {}'.format(dataset_size))
    np.random.shuffle(dataset)
    (trainset, testset) = (dataset[:trainset_size], dataset[trainset_size:])
    logger.debug('Trainset size: {}, Testset size: {}'.format(len(trainset), len(testset)))
    logger.debug('concatinating the train images on axis 0')
    train_image = np.vstack((tr[0] for tr in tqdm.tqdm(trainset[:])))
    logger.debug('concatinating the train labels on axis 0')
    train_label = [tr[1] for tr in tqdm.tqdm(trainset[:])]
    logger.info('concatinating the test images on axis 0')
    test_image = np.vstack((te[0] for te in tqdm.tqdm(testset[:])))
    logger.debug('concatinating the test labels on axis 0')
    test_label = [te[1] for te in tqdm.tqdm(testset[:])]
    logger.debug('train-images-shape: {}, test-images-shape: {}'.format(train_image.shape, test_image.shape))
    return ((train_image, train_label), (test_image, test_label))
def train_test_splitter(images, labels):
    dataset = [(image, label) for (image, label) in zip(images, labels)]
    dataset_size = len(dataset)
    trainset_size = int((0.8 * dataset_size))
    testset_size = (dataset_size - trainset_size)
    logger.debug('Dataset size: {}'.format(dataset_size))
    np.random.shuffle(dataset)
    (trainset, testset) = (dataset[:trainset_size], dataset[trainset_size:])
    logger.debug('Trainset size: {}, Testset size: {}'.format(len(trainset), len(testset)))
    logger.debug('concatinating the train images on axis 0')
    train_image = np.vstack((tr[0] for tr in tqdm.tqdm(trainset[:])))
    logger.debug('concatinating the train labels on axis 0')
    train_label = [tr[1] for tr in tqdm.tqdm(trainset[:])]
    logger.info('concatinating the test images on axis 0')
    test_image = np.vstack((te[0] for te in tqdm.tqdm(testset[:])))
    logger.debug('concatinating the test labels on axis 0')
    test_label = [te[1] for te in tqdm.tqdm(testset[:])]
    logger.debug('train-images-shape: {}, test-images-shape: {}'.format(train_image.shape, test_image.shape))
    return ((train_image, train_label), (test_image, test_label))