code: def eval_frame_dict(
      self, trk_objs, gt_objs, rtn_events=False, union=False
  ):
      if union:
          trk_tlwhs, trk_ids, trk_cls = unzip_objs_cls(trk_objs)[:3]
          gt_tlwhs, gt_ids, gt_cls = unzip_objs_cls(gt_objs)[:3]
  
          # get distance matrix
          iou_distance = mm.distances.iou_matrix(
              gt_tlwhs, trk_tlwhs, max_iou=0.5
          )
  
          # Set the distance between objects of different categories to nan
          gt_cls_len = len(gt_cls)
          trk_cls_len = len(trk_cls)
          # When the number of GT or Trk is 0, iou_distance dimension is (0,0)
          if gt_cls_len != 0 and trk_cls_len != 0:
              gt_cls = gt_cls.reshape(gt_cls_len, 1)
              gt_cls = np.repeat(gt_cls, trk_cls_len, axis=1)
              trk_cls = trk_cls.reshape(1, trk_cls_len)
              trk_cls = np.repeat(trk_cls, gt_cls_len, axis=0)
              iou_distance = np.where(
                  gt_cls == trk_cls, iou_distance, np.nan
              )
  
      else:
          trk_tlwhs, trk_ids = unzip_objs(trk_objs)[:2]
          gt_tlwhs, gt_ids = unzip_objs(gt_objs)[:2]
  
          # get distance matrix
          iou_distance = mm.distances.iou_matrix(
              gt_tlwhs, trk_tlwhs, max_iou=0.5
          )
  
      self.acc.update(gt_ids, trk_ids, iou_distance)
  
      if (
          rtn_events
          and iou_distance.size > 0
          and hasattr(self.acc, "mot_events")
      ):
          events = (
              self.acc.mot_events
          )  # only supported by https://github.com/longcw/py-motmetrics
      else:
          events = None
      return events
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import copy
  import sys
  import math
  from collections import defaultdict
  import numpy
  import pandas
  from .metrics import Metric
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 4 for calling the MCMOTEvaluator obj's underlying member method code with example usage: obj.eval_frame_dict(trk_objs, gt_objs, rtn_events, union) and returns: events