docstr: 设置推理其模型.
  
  Parameters
  ----------
  params_path : str
      模型路径
  
  use_gpu : bool
      None:检测，根据paddle版本判断
      bool:按照指定是否开启GPU
  
  Returns
  -------
  bool, str
      是否成功设置模型, 失败原因
docstr_tok: ["\u8bbe\u7f6e\u63a8\u7406\u5176\u6a21\u578b",".","Parameters","--","--","--","--","--","params_path",":","str","\u6a21\u578b\u8def\u5f84","use_gpu",":","bool","None",":","\u68c0\u6d4b\uff0c\u6839\u636epaddle\u7248\u672c\u5224\u65ad","bool",":","\u6309\u7167\u6307\u5b9a\u662f\u5426\u5f00\u542fGPU","Returns","--","--","--","-","bool",",","str","\u662f\u5426\u6210\u529f\u8bbe\u7f6e\u6a21\u578b",",","\u5931\u8d25\u539f\u56e0"]
code: def setModel(self, param_path=None, use_gpu=None):
      """设置推理其模型.
  
      Parameters
      ----------
      params_path : str
          模型路径
  
      use_gpu : bool
          None:检测，根据paddle版本判断
          bool:按照指定是否开启GPU
  
      Returns
      -------
      bool, str
          是否成功设置模型, 失败原因
  
      """
      if param_path is not None:
          model_path = param_path.replace(".pdiparams", ".pdmodel")
          if not osp.exists(model_path):
              raise Exception(f"未在 {model_path} 找到模型文件")
          if use_gpu is None:
              if (
                  paddle.device.is_compiled_with_cuda()
              ):  # TODO: 可以使用GPU却返回False
                  use_gpu = True
              else:
                  use_gpu = False
          logger.info(
              f"User paddle compiled with gpu: use_gpu {use_gpu}"
          )
          tic = time.time()
          try:
              self.model = EISegModel(model_path, param_path, use_gpu)
              self.reset_predictor()  # 即刻生效
          except KeyError as e:
              return False, str(e)
          logger.info(
              f"Load model {model_path} took {time.time() - tic}"
          )
          return True, "模型设置成功"
  
imports: import json
  import logging
  import os.path
  import time
  import cv2
  import numpy
  import paddle
  from skimage.measure import label
  import util
  from eiseg import logger
  from inference import clicker
  from inference.predictor import get_predictor
  from eiseg.models import EISegModel
  from util import LabelList
  from util.vis import draw_with_blend_and_clicks
label_desc: Use image node_id 3 for calling the InteractiveController obj's underlying member method code with example usage: obj.setModel(param_path, use_gpu) and returns: True,  str, False,  str