'Helper function for preparing groundtruth data for target assignment.
In order to be consistent with the model.DetectionModel interface,
groundtruth boxes are specified in normalized coordinates and classes are
specified as label indices with no assumed background category.  To prepare
for target assignment, we:
1) convert boxes to absolute coordinates,
2) add a background class at class index 0
Args:
image_shape: A 1-D int32 tensor of shape [4] representing the shape of the
input image batch.
Returns:
groundtruth_boxlists: A list of BoxLists containing (absolute) coordinates
of the groundtruth boxes.
groundtruth_classes_with_background_list: A list of 2-D one-hot
(or k-hot) tensors of shape [num_boxes, num_classes+1] containing the
class targets with the 0th index assumed to map to the background class.'

def _format_groundtruth_data(self, image_shape):

    groundtruth_boxlists = [box_list_ops.to_absolute_coordinates(box_list.BoxList(boxes), image_shape[1], image_shape[2]) for boxes in self.groundtruth_lists(fields.BoxListFields.boxes)]
    groundtruth_classes_with_background_list = [tf.to_float(tf.pad(one_hot_encoding, [[0, 0], [1, 0]], mode='CONSTANT')) for one_hot_encoding in self.groundtruth_lists(fields.BoxListFields.classes)]
    return (groundtruth_boxlists, groundtruth_classes_with_background_list)
