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
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"]
docstr: Args:
      input (str) or (list): video file path or image data list
  Returns:
      results (dict): 
docstr_tok: ["Args",":","input","(","str",")","or","(","list",")",":","video","file","path","or","image","data","list","Returns",":","results","(","dict",")",":"]
code: def predict(self, input):
      """
      Args:
          input (str) or (list): video file path or image data list
      Returns:
          results (dict):
      """
  
      input_names = self.predictor.get_input_names()
      input_tensor = self.predictor.get_input_handle(input_names[0])
  
      output_names = self.predictor.get_output_names()
      output_tensor = self.predictor.get_output_handle(output_names[0])
  
      # preprocess
      self.recognize_times.preprocess_time_s.start()
      if type(input) == str:
          inputs = self.preprocess_video(input)
      else:
          inputs = self.preprocess_frames(input)
      self.recognize_times.preprocess_time_s.end()
  
      inputs = (
          np.expand_dims(inputs, axis=0)
          .repeat(self.batch_size, axis=0)
          .copy()
      )
  
      input_tensor.copy_from_cpu(inputs)
  
      # model prediction
      self.recognize_times.inference_time_s.start()
      self.predictor.run()
      self.recognize_times.inference_time_s.end()
  
      output = output_tensor.copy_to_cpu()
  
      # postprocess
      self.recognize_times.postprocess_time_s.start()
      classes, scores = self.postprocess(output)
      self.recognize_times.postprocess_time_s.end()
  
      return classes, scores
  
imports: import os
  import yaml
  import glob
  import cv2
  import numpy
  import math
  import paddle
  import sys
  import paddle.nn.functional
  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 video_action_preprocess import VideoDecoder, Sampler, Scale, CenterCrop, Normalization, Image2Array
label_desc: Use image node_id 5 for calling the VideoActionRecognizer obj's underlying member method code with example usage: obj.predict(input) and returns: classes,  scores