class_docstr: Class that provides tracking of semantic segmentation as well as
  instance segmentation 
class_docstr_tok: ["Class","that","provides","tracking","of","semantic","segmentation","as","well","as","instance","segmentation"]
docstr: Computes the ratio of True positives, False positives and accuracy
          
docstr_tok: ["Computes","the","ratio","of","True","positives",",","False","positives","and","accuracy"]
code: def _compute_acc(
      clusters,
      predicted_labels,
      labels,
      batch,
      num_instances,
      iou_threshold,
  ):
      """Computes the ratio of True positives, False positives and accuracy"""
      iou_values, gt_ids = instance_iou(
          clusters, labels.instance_labels, batch
      ).max(1)
      gt_ids += 1
      instance_offsets = torch.cat(
          (
              torch.tensor([0]).to(num_instances.device),
              num_instances.cumsum(-1),
          )
      )
      tp = 0
      fp = 0
      for i, iou in enumerate(iou_values):
          # Too low iou, no match in ground truth
          if iou < iou_threshold:
              fp += 1
              continue
  
          # Check that semantic is correct
          sample_idx = batch[clusters[i][0]]
          sample_mask = batch == sample_idx
          instance_offset = instance_offsets[sample_idx]
          gt_mask = labels.instance_labels[sample_mask] == (
              gt_ids[i] - instance_offset
          )
          gt_classes = labels.y[sample_mask][
              torch.nonzero(gt_mask, as_tuple=False)
          ]
          gt_classes, counts = torch.unique(
              gt_classes, return_counts=True
          )
          gt_class = gt_classes[counts.max(-1)[1]]
          pred_class = predicted_labels[clusters[i][0]]
          if gt_class == pred_class:
              tp += 1
          else:
              fp += 1
      acc = tp / len(clusters)
      tp = tp / torch.sum(labels.num_instances).cpu().item()
      fp = fp / torch.sum(labels.num_instances).cpu().item()
      return tp, fp, acc
  
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 5 for calling the PanopticTracker obj's underlying member method code with example usage: obj._compute_acc(clusters, predicted_labels, labels, batch, num_instances, iou_threshold) and returns: tp,  fp,  acc