def parse_dir(save_dir):
    """Parses the save directory to get only the directory (without the file name) to save the pictures to

    :param save_dir: save directory string
    :return: save directory string without the file name
    """
    dir_list = save_dir.split('/')
    dir = ''
    if len(dir_list) == 1:
        dir_list = dir_list[0].split('\\')
    if not(len(dir_list) == 1):
        for elem in dir_list[:-1]:
            dir += elem + '/'

    return dir