class_docstr: This is the accelerated model for tensorflow and onnxruntime.
class_docstr_tok: ["This","is","the","accelerated","model","for","tensorflow","and","onnxruntime","."]
code: def preprocess(self, args: Sequence[Any], kwargs: Dict[str, Any]):
      invalidInputError(
          self.ortsess is not None,
          "Please create an instance by InferenceOptimizer.trace()",
      )
      # todo: add argument check
      inputs = args if self._mode == "arg" else kwargs
      inputs = convert_all(inputs, "numpy", self._inputs_dtypes)
      return inputs
  
imports: import os
  from bigdl.nano.utils.common import SafePickle
  from pathlib import Path
  from typing import Sequence, Any, Union, Dict
  from tempfile import TemporaryDirectory
  import tensorflow
  from bigdl.nano.utils.tf import convert_all
  from bigdl.nano.tf.model import KerasOptimizedModel
  from bigdl.nano.utils.common import invalidInputError
  from ..core.onnxruntime_model import ONNXRuntimeModel
  import onnxruntime
label_desc: Use image node_id 2 for calling the KerasONNXRuntimeModel obj's underlying member method code with example usage: obj.preprocess(args, kwargs) and returns: inputs