def METHOD_NAME(annotation_file, images_folder):
    images_folder = Path(images_folder)
    anno_dict = OrderedDict()
    with open(annotation_file, encoding="utf8") as data_file:
        json_annotation = json.load(data_file)
    annotation = json_annotation["annotations"]
    for imgAnnotation in annotation:
        img_path = images_folder / "{0:012d}.jpg".format(imgAnnotation["image_id"])
        name = str(imgAnnotation["category_id"])
        label_idx = COCO_NAMES.index(name)
        bbox = imgAnnotation["bbox"]
        if bbox is None or bbox == "":
            raise ValueError("No annotation for {}".format(img_path))
        bbox[2] = bbox[0] + bbox[2]
        bbox[3] = bbox[1] + bbox[3]
        anno_dict.setdefault(img_path.as_posix(), []).append({"bbox": bbox, "label_idx": label_idx})
    return anno_dict