def gen_caption_from_classes(class_names, templates):
    """
    Given a list of class names, return a list of template augmented captions,
    and the class_idx of these captions.
    captions: A list of strings describing each class
    labels_list: A list of ints representing the class index
    """
    captions = []
    labels_list = []
    for i, class_name in enumerate(class_names):
        if type(class_name) == str:
            class_name = [class_name]
        for c in class_name:
            for template in templates:
                caption = template.format(c)
                captions.append(caption)
                labels_list.append(i)
    return captions, labels_list