def convert_tf_to_crowdsourcing_format(images, detections):
    """
    Args:
        images: dictionary {image_id : image info} (images from Steve's code)
        detections: detection output from multibox
    Returns:
      dict : a dictionary mapping image_ids to bounding box annotations
    """
    image_annotations = {}
    for detection in detections:
        image_id = str(detection['image_id'])
        score = detection['score']
        x1, y1, x2, y2 = detection['bbox']

        # GVH: Do we want to check for reversal or area issues? 

        image_width = images[image_id]['width']
        image_height = images[image_id]['height']

        if image_id not in image_annotations:
            image_annotations[image_id] = {
                "anno" : {
                    "bboxes" : []
                },
                "image_id": image_id, 
                "image_width": image_width, 
                "image_height": image_height
            }

        bboxes = image_annotations[image_id]["anno"]["bboxes"]

        bboxes.append({
            "x": x1 * image_width, 
            "y": y1 * image_height, 
            "x2": x2 * image_width,
            "y2": y2 * image_height,
            "image_height": image_height, 
            "image_width": image_width,
            "score" : score
        })
    
    return image_annotations