code: def find_bbox_template(text, img_w, img_h):
      entities = []
      boxes = []
  
      # Regular expression pattern to match entities and boxes
      pattern = r"([a-zA-Z\s]+)\s+(\[[\d,\s]+\])"
  
      # Find all matches in the text
      matches = re.findall(pattern, text)
  
      for entity, box_str in matches:
          # Append the entity to the entities list
          entities.append(entity.strip())
  
          # Convert the box string to a list of integers and append to the boxes list
          box = list(map(int, box_str.strip("[]").split(",")))
          resized_box = resize_bbox(box, img_w, img_h)
          boxes.append(resized_box)
  
      return entities, boxes
  
imports: import argparse
  from typing import Any, Tuple
  import torch
  import os
  import json
  from tqdm import tqdm
  from ferret.mm_utils import tokenizer_image_token, get_model_name_from_path, KeywordsStoppingCriteria
  from ferret.model.builder import load_pretrained_model
  from ferret.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
  from ferret.conversation import conv_templates, SeparatorStyle
  from ferret.utils import disable_torch_init
  from PIL import Image
  import re
  import math
  import torchvision
  import numpy
  from copy import deepcopy
  from PIL import Image, ImageDraw, ImageFont
label_desc: Use image node_id 6 for calling a global function with example usage: find_bbox_template(text, img_w, img_h) and returns: entities,  boxes