code: def cv2_to_base64(image):
      # return base64.b64encode(image)
      data = cv2.imencode(".jpg", image)[1]
      return base64.b64encode(data.tostring()).decode("utf8")
  
imports: from __future__ import absolute_import
  from __future__ import division
  import os
  import cv2
  import argparse
  import base64
  import paddlex
  from math import *
  import time, math, re
  import numpy
  import paddlehub
  from paddlehub.module.module import moduleinfo, runnable, serving
label_desc: Use image node_id 2 for calling a global function with example usage: cv2_to_base64(image) and returns: base64