def _compute_object_center_loss(self, input_height, input_width, object_center_predictions, per_pixel_weights):
    'Computes the object center loss.\n\n    Args:\n      input_height: An integer scalar tensor representing input image height.\n      input_width: An integer scalar tensor representing input image width.\n      object_center_predictions: A list of float tensors of shape [batch_size,\n        out_height, out_width, num_classes] representing the object center\n        feature maps.\n      per_pixel_weights: A float tensor of shape [batch_size,\n        out_height * out_width, 1] with 1s in locations where the spatial\n        coordinates fall within the height and width in true_image_shapes.\n\n    Returns:\n      A float scalar tensor representing the object center loss per instance.\n    '
    gt_boxes_list = self.groundtruth_lists(fields.BoxListFields.boxes)
    gt_classes_list = self.groundtruth_lists(fields.BoxListFields.classes)
    gt_weights_list = self.groundtruth_lists(fields.BoxListFields.weights)
    if self._center_params.use_only_known_classes:
        gt_labeled_classes_list = self.groundtruth_lists(fields.InputDataFields.groundtruth_labeled_classes)
        batch_labeled_classes = tf.stack(gt_labeled_classes_list, axis=0)
        batch_labeled_classes_shape = tf.shape(batch_labeled_classes)
        batch_labeled_classes = tf.reshape(batch_labeled_classes, [batch_labeled_classes_shape[0], 1, batch_labeled_classes_shape[(- 1)]])
        per_pixel_weights = (per_pixel_weights * batch_labeled_classes)
    assigner = self._target_assigner_dict[OBJECT_CENTER]
    heatmap_targets = assigner.assign_center_targets_from_boxes(height=input_height, width=input_width, gt_boxes_list=gt_boxes_list, gt_classes_list=gt_classes_list, gt_weights_list=gt_weights_list)
    flattened_heatmap_targets = _flatten_spatial_dimensions(heatmap_targets)
    num_boxes = _to_float32(get_num_instances_from_weights(gt_weights_list))
    loss = 0.0
    object_center_loss = self._center_params.classification_loss
    for pred in object_center_predictions:
        pred = _flatten_spatial_dimensions(pred)
        loss += object_center_loss(pred, flattened_heatmap_targets, weights=per_pixel_weights)
    loss_per_instance = (tf.reduce_sum(loss) / (float(len(object_center_predictions)) * num_boxes))
    return loss_per_instance
Computes the object center loss.

Args:
  input_height: An integer scalar tensor representing input image height.
  input_width: An integer scalar tensor representing input image width.
  object_center_predictions: A list of float tensors of shape [batch_size,
    out_height, out_width, num_classes] representing the object center
    feature maps.
  per_pixel_weights: A float tensor of shape [batch_size,
    out_height * out_width, 1] with 1s in locations where the spatial
    coordinates fall within the height and width in true_image_shapes.

Returns:
  A float scalar tensor representing the object center loss per instance.
def _compute_object_center_loss(self, input_height, input_width, object_center_predictions, per_pixel_weights):
    'Computes the object center loss.\n\n    Args:\n      input_height: An integer scalar tensor representing input image height.\n      input_width: An integer scalar tensor representing input image width.\n      object_center_predictions: A list of float tensors of shape [batch_size,\n        out_height, out_width, num_classes] representing the object center\n        feature maps.\n      per_pixel_weights: A float tensor of shape [batch_size,\n        out_height * out_width, 1] with 1s in locations where the spatial\n        coordinates fall within the height and width in true_image_shapes.\n\n    Returns:\n      A float scalar tensor representing the object center loss per instance.\n    '
    gt_boxes_list = self.groundtruth_lists(fields.BoxListFields.boxes)
    gt_classes_list = self.groundtruth_lists(fields.BoxListFields.classes)
    gt_weights_list = self.groundtruth_lists(fields.BoxListFields.weights)
    if self._center_params.use_only_known_classes:
        gt_labeled_classes_list = self.groundtruth_lists(fields.InputDataFields.groundtruth_labeled_classes)
        batch_labeled_classes = tf.stack(gt_labeled_classes_list, axis=0)
        batch_labeled_classes_shape = tf.shape(batch_labeled_classes)
        batch_labeled_classes = tf.reshape(batch_labeled_classes, [batch_labeled_classes_shape[0], 1, batch_labeled_classes_shape[(- 1)]])
        per_pixel_weights = (per_pixel_weights * batch_labeled_classes)
    assigner = self._target_assigner_dict[OBJECT_CENTER]
    heatmap_targets = assigner.assign_center_targets_from_boxes(height=input_height, width=input_width, gt_boxes_list=gt_boxes_list, gt_classes_list=gt_classes_list, gt_weights_list=gt_weights_list)
    flattened_heatmap_targets = _flatten_spatial_dimensions(heatmap_targets)
    num_boxes = _to_float32(get_num_instances_from_weights(gt_weights_list))
    loss = 0.0
    object_center_loss = self._center_params.classification_loss
    for pred in object_center_predictions:
        pred = _flatten_spatial_dimensions(pred)
        loss += object_center_loss(pred, flattened_heatmap_targets, weights=per_pixel_weights)
    loss_per_instance = (tf.reduce_sum(loss) / (float(len(object_center_predictions)) * num_boxes))
    return loss_per_instance