import codecs


def load_classes(classes_path):
    """
    Loads the classes from file `classes_path`.
    """
    c2i = {}
    i2c = {}
    c_id = 0
    with codecs.open(classes_path, 'r', 'utf-8') as cf:
        for line in cf:
            label = line.strip()
            c2i[label] = c_id
            i2c[c_id] = label
            c_id += 1
    return c2i, i2c