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"]
code: def _gt_instances_per_scan(
      instance_labels, gt_labels, batch, scan_id_offset
  ):
      batch_size = batch[-1] + 1
      instances = []
      for b in range(batch_size):
          sample_mask = batch == b
          instances_in_sample = instance_labels[sample_mask]
          gt_labels_sample = gt_labels[sample_mask]
          num_instances = torch.max(instances_in_sample)
          scan_id = b + scan_id_offset
          for i in range(num_instances):
              instance_indices = (
                  torch.where(instances_in_sample == i + 1)[0]
                  .cpu()
                  .numpy()
              )
              instances.append(
                  _Instance(
                      classname=gt_labels_sample[
                          instance_indices[0]
                      ].item(),
                      score=-1,
                      indices=instance_indices,
                      scan_id=scan_id,
                  )
              )
      return instances
  
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 8 for calling the PanopticTracker obj's underlying member method code with example usage: obj._gt_instances_per_scan(instance_labels, gt_labels, batch, scan_id_offset) and returns: instances