code: def _eval_cls(self, classname, iou_threshold):
      preds = self._pred_clusters.get(classname, [])
      allgts = self._gt_clusters.get(classname, {})
      visited = {
          scan_id: len(gt) * [False] for scan_id, gt in allgts.items()
      }
      ngt = 0
      for gts in allgts.values():
          ngt += len(gts)
  
      # Start with most confident first
      preds.sort(key=lambda x: x.score, reverse=True)
      tp = np.zeros(len(preds))
      fp = np.zeros(len(preds))
      for p, pred in enumerate(preds):
          scan_id = pred.scan_id
          gts = allgts.get(scan_id, [])
          if len(gts) == 0:
              fp[p] = 1
              continue
  
          # Find best macth in ground truth
          ioumax, best_match = pred.find_best_match(gts)
  
          if ioumax < iou_threshold:
              fp[p] = 1
              continue
  
          if visited[scan_id][best_match]:
              fp[p] = 1
          else:
              visited[scan_id][best_match] = True
              tp[p] = 1
  
      fp = np.cumsum(fp)
      tp = np.cumsum(tp)
      rec = tp / float(ngt)
  
      # avoid divide by zero in case the first detection matches a difficult
      # ground truth
      prec = tp / np.maximum(tp + fp, np.finfo(np.float64).eps)
      ap = voc_ap(rec, prec)
      return rec, prec, ap
  
imports: import torchnet
  from typing import NamedTuple, Dict, Any, List, Tuple
  import torch
  import numpy
  from torch_scatter import scatter_add
  from collections import OrderedDict, defaultdict
  from torch_points3d.models.model_interface import TrackerInterface
  from torch_points3d.metrics.segmentation_tracker import SegmentationTracker
  from torch_points3d.metrics.base_tracker import BaseTracker, meter_value
  from torch_points3d.models.panoptic.structures import PanopticResults, PanopticLabels
  from torch_points_kernels import instance_iou
  from .box_detection.ap import voc_ap
label_desc: Use image node_id 3 for calling the InstanceAPMeter obj's underlying member method code with example usage: obj._eval_cls(classname, iou_threshold) and returns: rec,  prec,  ap