class_docstr: BoxIOU.
docstr: Compute VOC AP given precision and recall.
docstr_tok: ["Compute","VOC","AP","given","precision","and","recall","."]
code: def _voc_ap(self, rec, prec):
      """Compute VOC AP given precision and recall."""
      mrec = np.concatenate(([0.0], rec, [1.0]))
      mpre = np.concatenate(([0.0], prec, [0.0]))
      # compute the precision envelope
      for i in range(mpre.size - 1, 0, -1):
          mpre[i - 1] = np.maximum(mpre[i - 1], mpre[i])
      # to calculate area under PR curve, look for points
      # where X axis (recall) changes value
      i = np.where(mrec[1:] != mrec[:-1])[0]
      # and sum (\Delta recall) * prec
      return np.sum((mrec[i + 1] - mrec[i]) * mpre[i + 1])
  
imports: import os
  import pickle
  from absl import logging
  import matplotlib.pyplot
  import numpy
  import tensorflow
  from tensorflow_graphics.geometry.representation import grid
  from tensorflow_graphics.math.interpolation import trilinear
  from tensorflow_graphics.projects.points_to_3Dobjects.models import centernet_utils
  from tensorflow_graphics.projects.points_to_3Dobjects.utils import tf_utils
  from google3.pyglib import gfile
  from google3.third_party.google_research.google_research.tf3d.object_detection.box_utils import np_box_ops
label_desc: Use image node_id 5 for calling the BoxIoUMetric obj's underlying member method code with example usage: obj._voc_ap(rec, prec) and returns: np