class_docstr: Args:
      model_dir (str): root path of model.pdiparams, model.pdmodel and infer_cfg.yml
      device (str): Choose the device you want to run, it can be: CPU/GPU/XPU/NPU, default is CPU
      run_mode (str): mode of running(paddle/trt_fp32/trt_fp16)
      batch_size (int): size of pre batch in inference
      trt_min_shape (int): min shape for dynamic shape in trt
      trt_max_shape (int): max shape for dynamic shape in trt
      trt_opt_shape (int): opt shape for dynamic shape in trt
      trt_calib_mode (bool): If the model is produced by TRT offline quantitative
          calibration, trt_calib_mode need to set True
      cpu_threads (int): cpu threads
      enable_mkldnn (bool): whether to open MKLDNN
      threshold (float): The threshold of score for action feature object detection.
      display_frames (int): The duration for corresponding detected action. 
      skip_frame_num (int): The number of frames for interval prediction. A skipped frame will 
          reuse the result of its last frame. If it is set to 0, no frame will be skipped. Default
          is 0.
class_docstr_tok: ["Args",":","model_dir","(","str",")",":","root","path","of","model.pdiparams",",","model.pdmodel","and","infer_cfg.yml","device","(","str",")",":","Choose","the","device","you","want","to","run",",","it","can","be",":","CPU\/GPU\/XPU\/NPU",",","default","is","CPU","run_mode","(","str",")",":","mode","of","running","(","paddle\/trt_fp32\/trt_fp16",")","batch_size","(","int",")",":","size","of","pre","batch","in","inference","trt_min_shape","(","int",")",":","min","shape","for","dynamic","shape","in","trt","trt_max_shape","(","int",")",":","max","shape","for","dynamic","shape","in","trt","trt_opt_shape","(","int",")",":","opt","shape","for","dynamic","shape","in","trt","trt_calib_mode","(","bool",")",":","If","the","model","is","produced","by","TRT","offline","quantitative","calibration",",","trt_calib_mode","need","to","set","True","cpu_threads","(","int",")",":","cpu","threads","enable_mkldnn","(","bool",")",":","whether","to","open","MKLDNN","threshold","(","float",")",":","The","threshold","of","score","for","action","feature","object","detection",".","display_frames","(","int",")",":","The","duration","for","corresponding","detected","action",".","skip_frame_num","(","int",")",":","The","number","of","frames","for","interval","prediction",".","A","skipped","frame","will","reuse","the","result","of","its","last","frame",".","If","it","is","set","to","0",",","no","frame","will","be","skipped",".","Default","is","0","."]
code: def match_action_with_id(self, cls_result, mot_result):
      mot_bboxes = mot_result.get("boxes")
  
      mot_id = []
      act_res = []
  
      for idx in range(len(mot_bboxes)):
          tracker_id = mot_bboxes[idx, 0]
  
          cls_id_res = 1
          cls_score_res = -1.0
          for cls_id in range(len(cls_result[idx])):
              score = cls_result[idx][cls_id]
              if score > cls_score_res:
                  cls_id_res = cls_id
                  cls_score_res = score
  
          # Current now,  class 0 is positive, class 1 is negative.
          if cls_id_res == 1 or (
              cls_id_res == 0 and cls_score_res < self.threshold
          ):
              (
                  history_cls,
                  life_remain,
                  history_score,
              ) = self.result_history.get(
                  tracker_id, [1, self.frame_life, -1.0]
              )
              cls_id_res = history_cls
              cls_score_res = 1 - cls_score_res
              life_remain -= 1
              if life_remain <= 0 and tracker_id in self.result_history:
                  del self.result_history[tracker_id]
              elif tracker_id in self.result_history:
                  self.result_history[tracker_id][1] = life_remain
              else:
                  self.result_history[tracker_id] = [
                      cls_id_res,
                      life_remain,
                      cls_score_res,
                  ]
          else:
              self.result_history[tracker_id] = [
                  cls_id_res,
                  self.frame_life,
                  cls_score_res,
              ]
  
          action_ret = {"class": cls_id_res, "score": cls_score_res}
          mot_id.append(tracker_id)
          act_res.append(action_ret)
      result = list(zip(mot_id, act_res))
      self.id_in_last_frame = mot_id
  
      return result
  
imports: import os
  import yaml
  import glob
  import cv2
  import numpy
  import math
  import paddle
  import sys
  from paddle.inference import Config, create_predictor
  from python.utils import argsparser, Timer, get_current_memory_mb
  from python.benchmark_utils import PaddleInferBenchmark
  from python.infer import Detector, print_arguments
  from attr_infer import AttrDetector
label_desc: Use image node_id 6 for calling the ClsActionRecognizer obj's underlying member method code with example usage: obj.match_action_with_id(cls_result, mot_result) and returns: result