import glob


def get_image_paths(dataset='cars'):
    """
    Loads image paths for selected dataset.
    :param dataset: Dataset that should be loaded. ['cars', 'notcars']
    :return: Path list 
    """
    path_list = []
    if dataset == 'cars':
        print('Loading data set for \'cars\'...')
        # GTI
        path = 'data/vehicles/GTI*/*.png'
        paths = glob.glob(path)
        print(path)
        print('\t{} elements'.format(len(paths)))
        path_list += paths

        # KITTI
        path = 'data/vehicles/KITTI*/*.png'
        paths = glob.glob(path)
        print(path)
        print('\t{} elements'.format(len(paths)))
        path_list += paths
    elif dataset == 'notcars':
        print('Loading data set for \'notcars\'...')
        # GTI
        path = 'data/non-vehicles/GTI*/*.png'
        paths = glob.glob(path)
        print(path)
        print('\t{} elements'.format(len(paths)))
        path_list += paths

        # Udacity data
        path = 'data/non-vehicles/Extras/*.png'
        paths = glob.glob(path)
        print(path)
        print('\t{} elements'.format(len(paths)))
        path_list += paths

        # Manually extracted data
        path = 'data/non-vehicles/Extracted/*.png'
        paths = glob.glob(path)
        print(path)
        print('\t{} elements'.format(len(paths)))
        path_list += paths
    else:
        raise Exception('There are only two possible choices for c: \'cars\' and \'notcars\'')

    return path_list