def _compute_track_embedding_loss(self, input_height, input_width, object_reid_predictions):
    'Computes the object ReID loss.\n\n    The embedding is trained as a classification task where the target is the\n    ID of each track among all tracks in the whole dataset.\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_reid_predictions: A list of float tensors of shape [batch_size,\n        out_height, out_width, reid_embed_size] representing the object\n        embedding feature maps.\n\n    Returns:\n      A float scalar tensor representing the object ReID loss per instance.\n    '
    gt_track_ids_list = self.groundtruth_lists(fields.BoxListFields.track_ids)
    gt_boxes_list = self.groundtruth_lists(fields.BoxListFields.boxes)
    gt_weights_list = self.groundtruth_lists(fields.BoxListFields.weights)
    num_boxes = _to_float32(get_num_instances_from_weights(gt_weights_list))
    assigner = self._target_assigner_dict[TRACK_TASK]
    (batch_indices, batch_weights, track_targets) = assigner.assign_track_targets(height=input_height, width=input_width, gt_track_ids_list=gt_track_ids_list, gt_boxes_list=gt_boxes_list, gt_weights_list=gt_weights_list)
    batch_weights = tf.expand_dims(batch_weights, (- 1))
    loss = 0.0
    object_reid_loss = self._track_params.classification_loss
    for pred in object_reid_predictions:
        embedding_pred = cn_assigner.get_batch_predictions_from_indices(pred, batch_indices)
        reid_classification = self.track_reid_classification_net(embedding_pred)
        loss += object_reid_loss(reid_classification, track_targets, weights=batch_weights)
    loss_per_instance = (tf.reduce_sum(loss) / (float(len(object_reid_predictions)) * num_boxes))
    return loss_per_instance
Computes the object ReID loss.

The embedding is trained as a classification task where the target is the
ID of each track among all tracks in the whole dataset.

Args:
  input_height: An integer scalar tensor representing input image height.
  input_width: An integer scalar tensor representing input image width.
  object_reid_predictions: A list of float tensors of shape [batch_size,
    out_height, out_width, reid_embed_size] representing the object
    embedding feature maps.

Returns:
  A float scalar tensor representing the object ReID loss per instance.
def _compute_track_embedding_loss(self, input_height, input_width, object_reid_predictions):
    'Computes the object ReID loss.\n\n    The embedding is trained as a classification task where the target is the\n    ID of each track among all tracks in the whole dataset.\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_reid_predictions: A list of float tensors of shape [batch_size,\n        out_height, out_width, reid_embed_size] representing the object\n        embedding feature maps.\n\n    Returns:\n      A float scalar tensor representing the object ReID loss per instance.\n    '
    gt_track_ids_list = self.groundtruth_lists(fields.BoxListFields.track_ids)
    gt_boxes_list = self.groundtruth_lists(fields.BoxListFields.boxes)
    gt_weights_list = self.groundtruth_lists(fields.BoxListFields.weights)
    num_boxes = _to_float32(get_num_instances_from_weights(gt_weights_list))
    assigner = self._target_assigner_dict[TRACK_TASK]
    (batch_indices, batch_weights, track_targets) = assigner.assign_track_targets(height=input_height, width=input_width, gt_track_ids_list=gt_track_ids_list, gt_boxes_list=gt_boxes_list, gt_weights_list=gt_weights_list)
    batch_weights = tf.expand_dims(batch_weights, (- 1))
    loss = 0.0
    object_reid_loss = self._track_params.classification_loss
    for pred in object_reid_predictions:
        embedding_pred = cn_assigner.get_batch_predictions_from_indices(pred, batch_indices)
        reid_classification = self.track_reid_classification_net(embedding_pred)
        loss += object_reid_loss(reid_classification, track_targets, weights=batch_weights)
    loss_per_instance = (tf.reduce_sum(loss) / (float(len(object_reid_predictions)) * num_boxes))
    return loss_per_instance