def read_file(filepath, classes):
    """
        reads in a file and YOLOv5 format,
        and returns that information formatted with index codes converted
        to symbol classes and the center information grouped
        input:
            filepath: path to a file in YOLOv5 format
            classes: the list of symbol classes for the model
        output:
            list, with each element corresponding to one bounding box
            each element is in the format
            'symbol class', [x_center, y_center]]
    """
    with open(filepath) as file:
        lines = file.readlines()
    # remove whitespace and split each line into 5 numbers
    lines = list(map(lambda line: line.strip().split(' '), lines))
    # convert from strings to numbers
    lines = list(map(lambda line: list(map(float, line)), lines))
    # change to nested list with 3 elements: symbol class, [x_center, y_center]
    converted = list(
        map(lambda line: [classes[int(line[0])], line[1:3]], lines))
    return converted