code: def show_location(sketch_pad, chatbot):
      image = sketch_pad["image"]
      img_w, img_h = image.size
      new_bboxes = []
      old_bboxes = []
      # chatbot[0] is image.
      text = chatbot[1:]
      for round_i in text:
          human_input = round_i[0]
          model_output = round_i[1]
          # TODO: Difference: vocab representation.
          # pattern = r'\[x\d*=(\d+(?:\.\d+)?), y\d*=(\d+(?:\.\d+)?), x\d*=(\d+(?:\.\d+)?), y\d*=(\d+(?:\.\d+)?)\]'
          pattern = r"\[(\d+(?:\.\d+)?), (\d+(?:\.\d+)?), (\d+(?:\.\d+)?), (\d+(?:\.\d+)?)\]"
          matches = re.findall(pattern, model_output)
          for match in matches:
              x1, y1, x2, y2 = map(int, match)
              new_box = resize_bbox([x1, y1, x2, y2], img_w, img_h)
              new_bboxes.append(new_box)
              old_bboxes.append([x1, y1, x2, y2])
  
      set_old_bboxes = sorted(
          set(map(tuple, old_bboxes)),
          key=list(map(tuple, old_bboxes)).index,
      )
      list_old_bboxes = list(map(list, set_old_bboxes))
  
      set_bboxes = sorted(
          set(map(tuple, new_bboxes)),
          key=list(map(tuple, new_bboxes)).index,
      )
      list_bboxes = list(map(list, set_bboxes))
  
      output_image = deepcopy(image)
      draw = ImageDraw.Draw(output_image)
      font = ImageFont.truetype(
          "./ferret/serve/dejavu/DejaVuSans.ttf", 28
      )
      for i in range(len(list_bboxes)):
          x1, y1, x2, y2 = list_old_bboxes[i]
          x1_new, y1_new, x2_new, y2_new = list_bboxes[i]
          obj_string = "[obj{}]".format(i)
          for round_i in text:
              model_output = round_i[1]
              model_output = model_output.replace(
                  "[{}, {}, {}, {}]".format(x1, y1, x2, y2), obj_string
              )
              round_i[1] = model_output
          draw.rectangle(
              [(x1_new, y1_new), (x2_new, y2_new)],
              outline="red",
              width=3,
          )
          draw.text(
              (x1_new + 2, y1_new + 5),
              obj_string[1:-1],
              fill="red",
              font=font,
          )
  
      return (output_image, [chatbot[0]] + text, disable_btn)
  
imports: import argparse
  import datetime
  import json
  import os
  import time
  import gradio
  import requests
  from ferret.conversation import default_conversation, conv_templates, SeparatorStyle
  from ferret.constants import LOGDIR
  from ferret.utils import build_logger, server_error_msg, violates_moderation, moderation_msg
  import hashlib
  import re
  from copy import deepcopy
  from PIL import ImageDraw, ImageFont
  from gradio import processing_utils
  import numpy
  import torch
  import torch.nn.functional
  from scipy.ndimage import binary_dilation, binary_erosion
  import pdb
  from ferret.serve.gradio_css import code_highlight_css
label_desc: Use image node_id 14 for calling a global function with example usage: show_location(sketch_pad, chatbot) and returns: output_image,  unknown,  disable_btn