code: def get_id_photo_output(image, text):
      """
      Get the special size and background photo.
  
      Args:
          img(numpy:ndarray): The image array.
          size(str): The size user specified.
          bg(str): The background color user specified.
          download_size(str): The size for image saving.
  
      """
      image_ori = image.copy()
      image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
      masks = mask_generator.generate(image)
      pred_result, pseudo_map = masks2pseudomap(masks)  # PIL Image
      added_pseudo_map = visualize(
          image, pred_result, color_map=get_color_map_list(256)
      )
      cropped_objects = []
      image_pil = Image.fromarray(image)
      for mask in masks:
          bbox = [
              mask["bbox"][0],
              mask["bbox"][1],
              mask["bbox"][0] + mask["bbox"][2],
              mask["bbox"][1] + mask["bbox"][3],
          ]
          cropped_objects.append(
              segment_image(image_pil, mask["segmentation"]).crop(bbox)
          )
  
      scores = image_text_match(cropped_objects, str(text))
      text_matching_masks = []
      for idx, score in enumerate(scores):
          if score < 0.05:
              continue
          text_matching_mask = Image.fromarray(
              masks[idx]["segmentation"].astype("uint8") * 255
          )
          text_matching_masks.append(text_matching_mask)
  
      image_pil_ori = Image.fromarray(image_ori)
      alpha_image = Image.new("RGBA", image_pil_ori.size, (0, 0, 0, 0))
      alpha_color = (255, 0, 0, 180)
  
      draw = ImageDraw.Draw(alpha_image)
      for text_matching_mask in text_matching_masks:
          draw.bitmap((0, 0), text_matching_mask, fill=alpha_color)
  
      result_image = Image.alpha_composite(
          image_pil_ori.convert("RGBA"), alpha_image
      )
      res_download = download(result_image)
      return result_image, added_pseudo_map, res_download
  
imports: import os
  import cv2
  import time
  import sys
  import argparse
  import paddle
  import paddle.nn.functional
  import numpy
  from PIL import Image, ImageDraw
  import matplotlib.pyplot
  from segment_anything import sam_model_registry, SamAutomaticMaskGenerator
  from segment_anything.modeling.clip_paddle import build_clip_model, _transform
  from segment_anything.utils.sample_tokenizer import tokenize
  from paddleseg.utils.visualize import get_pseudo_color_map, get_color_map_list
label_desc: Use image node_id 6 for calling a global function with example usage: get_id_photo_output(image, text) and returns: result_image,  added_pseudo_map,  res_download