code: def cv2_to_base64(image: np.ndarray):
      """
      Convert data from BGR to base64 format.
      """
      data = cv2.imencode(".png", image)[1]
      return base64.b64encode(data.tostring()).decode("utf8")
  
imports: import random
  import base64
  from typing import Callable, Union, List, Tuple
  import cv2
  import numpy
  import paddle
  import paddle.nn.functional
  from paddleseg.transforms import functional
  from PIL import Image
label_desc: Use image node_id 3 for calling a global function with example usage: cv2_to_base64(image) and returns: base64