def generate_annotation_index(annotations):
    """Turn annotations into annotation index dictionary with
    image id as key and list of coco-like annotation objects as value.

    :param annotations: coco-like annotations list;
    :return: annotation index dictionary with image id as key and
             list of coco-like annotation objects as value;
    """
    annotation_index = {}
    for annotation in annotations:
        image_id = annotation['image_id']
        if image_id not in annotation_index:
            annotation_index[image_id] = []
        annotation_index[image_id].append(annotation)
    return annotation_index