code: def _build_bounding_box_lookup(bounding_box_file):
    
    lines = tf.gfile.FastGFile(bounding_box_file, 'r').readlines()
    images_to_bboxes = {}
    num_bbox = 0
    num_image = 0
    for l in lines:
      if l:
        parts = l.split(',')
        assert len(parts) == 5, ('Failed to parse: %s' % l)
        filename = parts[0]
        xmin = float(parts[1])
        ymin = float(parts[2])
        xmax = float(parts[3])
        ymax = float(parts[4])
        box = [xmin, ymin, xmax, ymax]
  
        if filename not in images_to_bboxes:
          images_to_bboxes[filename] = []
          num_image += 1
        images_to_bboxes[filename].append(box)
        num_bbox += 1
  
    print('Successfully read %d bounding boxes '
          'across %d images.' % (num_bbox, num_image))
    return images_to_bboxes
docs: Build a lookup from image file to bounding boxes.
  
    Args:
      bounding_box_file: string, path to file with bounding boxes annotations.
  
        Assumes each line of the file looks like:
  
          n00007846_64193.JPEG,0.0060,0.2620,0.7545,0.9940
  
        where each line corresponds to one bounding box annotation associated
        with an image. Each line can be parsed as:
  
          <JPEG file name>, <xmin>, <ymin>, <xmax>, <ymax>
  
        Note that there might exist mulitple bounding box annotations associated
        with an image file. This file is the output of process_bounding_boxes.py.
  
    Returns:
      Dictionary mapping image file names to a list of bounding boxes. This list
      contains 0+ bounding boxes.