code: def inference(self, model, image):
      det_inferencer = DetInferencer(
          model, scope="mmdet", device=get_free_device()
      )
      results_dict = det_inferencer(
          image, 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 ObjectDetectionTab obj's underlying member method code with example usage: obj.inference(model, image) and returns: vis