code: def load_openvino_model(
      path,
      framework="pytorch",
      device=None,
      cache_dir=None,
      shapes=None,
  ):
      """
      Load an OpenVINO model for inference from directory.
  
      :param path: Path to model to be loaded.
      :param framework: Only support pytorch and tensorflow now
      :param device: A string represents the device of the inference.
      :param cache_dir: A directory for OpenVINO to cache the model. Default to None.
      :param shapes: input shape. For example, 'input1[1,3,224,224],input2[1,4]',
                 '[1,3,224,224]'. This parameter affect model Parameter shape, can be
                 dynamic. For dynamic dimesions use symbol `?`, `-1` or range `low.. up`.'.
                 Only valid for openvino model, otherwise will be ignored.
      :return: PytorchOpenVINOModel model for OpenVINO inference.
      """
      if cache_dir is not None:
          from pathlib import Path
  
          Path(cache_dir).mkdir(exist_ok=True)
  
      if framework == "pytorch":
          from .pytorch.model import PytorchOpenVINOModel
  
          return PytorchOpenVINOModel._load(
              path, device=device, cache_dir=cache_dir, shapes=shapes
          )
      elif framework == "tensorflow":
          from .tf.model import KerasOpenVINOModel
  
          return KerasOpenVINOModel._load(
              path, device=device, cache_dir=cache_dir, shapes=shapes
          )
      else:
          invalidInputError(
              False,
              "The value {} for framework is not supported."
              " Please choose from 'pytorch'/'tensorflow'.",
          )
  
imports: from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 2 for calling a global function with example usage: load_openvino_model(path, framework, device, cache_dir, shapes) and returns: PytorchOpenVINOModel, KerasOpenVINOModel