code: def inference(self, model, image, text):
      ric_inferencer = RefImageCaptionInferencer(
          **self.model_info[model],
          scope="mmdet",
          device=get_free_device(),
      )
      results_dict = ric_inferencer(
          image, texts=text, 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 3 for calling the ReferImageCaptionTab obj's underlying member method code with example usage: obj.inference(model, image, text) and returns: vis