code: def inference(self, model, image, text):
      det_inferencer = DetInferencer(
          model, scope="mmdet", device=get_free_device()
      )
      results_dict = det_inferencer(
          image,
          texts=text,
          custom_entities=True,
          pred_score_thr=0.5,
          return_vis=True,
          no_save_vis=True,
      )
      vis = results_dict["visualization"][0]
      return vis
  
imports: import gradio
  import torch
  from mmengine.logging import MMLogger
  from mmdet.apis import DetInferencer
  from projects.XDecoder.xdecoder.inference import ImageCaptionInferencer, RefImageCaptionInferencer, TextToImageRegionRetrievalInferencer
label_desc: Use image node_id 4 for calling the OpenVocabObjectDetectionTab obj's underlying member method code with example usage: obj.inference(model, image, text) and returns: vis