def evaluate(self, relationships=None):
    """Compute evaluation result.

    Args:
      relationships: A dictionary of numerical label-text label mapping; if
        specified, returns per-relationship AP.

    Returns:
      A dictionary of metrics with the following fields -

      summary_metrics:
        'weightedAP@<matching_iou_threshold>IOU' : weighted average precision
        at the specified IOU threshold.
        'AP@<matching_iou_threshold>IOU/<relationship>' : AP per relationship.
        'mAP@<matching_iou_threshold>IOU': mean average precision at the
        specified IOU threshold.
        'Recall@50@<matching_iou_threshold>IOU': recall@50 at the specified IOU
        threshold.
        'Recall@100@<matching_iou_threshold>IOU': recall@100 at the specified
        IOU threshold.
      if relationships is specified, returns <relationship> in AP metrics as
      readable names, otherwise the names correspond to class numbers.
    """
    (weighted_average_precision, mean_average_precision, average_precisions, _,
     _, recall_50, recall_100, _, _) = (
         self._evaluation.evaluate())

    vrd_metrics = {
        (self._metric_prefix + 'weightedAP@{}IOU'.format(
            self._matching_iou_threshold)):
            weighted_average_precision,
        self._metric_prefix + 'mAP@{}IOU'.format(self._matching_iou_threshold):
            mean_average_precision,
        self._metric_prefix + 'Recall@50@{}IOU'.format(
            self._matching_iou_threshold):
            recall_50,
        self._metric_prefix + 'Recall@100@{}IOU'.format(
            self._matching_iou_threshold):
            recall_100,
    }
    if relationships:
      for key, average_precision in six.iteritems(average_precisions):
        vrd_metrics[self._metric_prefix + 'AP@{}IOU/{}'.format(
            self._matching_iou_threshold,
            relationships[key])] = average_precision
    else:
      for key, average_precision in six.iteritems(average_precisions):
        vrd_metrics[self._metric_prefix + 'AP@{}IOU/{}'.format(
            self._matching_iou_threshold, key)] = average_precision

    return vrd_metrics
Compute evaluation result.

    Args:
      relationships: A dictionary of numerical label-text label mapping; if
        specified, returns per-relationship AP.

    Returns:
      A dictionary of metrics with the following fields -

      summary_metrics:
        'weightedAP@<matching_iou_threshold>IOU' : weighted average precision
        at the specified IOU threshold.
        'AP@<matching_iou_threshold>IOU/<relationship>' : AP per relationship.
        'mAP@<matching_iou_threshold>IOU': mean average precision at the
        specified IOU threshold.
        'Recall@50@<matching_iou_threshold>IOU': recall@50 at the specified IOU
        threshold.
        'Recall@100@<matching_iou_threshold>IOU': recall@100 at the specified
        IOU threshold.
      if relationships is specified, returns <relationship> in AP metrics as
      readable names, otherwise the names correspond to class numbers.
    
inference_api/src/main/object_detection/utils/vrd_evaluation.py