code: def check_image_is_valid(imageBin):
      if imageBin is None:
          return False
      imageBuf = np.frombuffer(imageBin, dtype=np.uint8)
      img = cv2.imdecode(imageBuf, cv2.IMREAD_GRAYSCALE)
      imgH, imgW = img.shape[0], img.shape[1]
      if imgH * imgW == 0:
          return False
      return True
  
file_path: mmocr/tools/dataset_converters/textrecog/lmdb_converter.py
imports: import argparse
  import json
  import os
  import os.path
  import cv2
  import lmdb
  import numpy
  from mmocr.utils import list_from_file
label_desc: Use image node_id 2 for calling a global function with example usage: check_image_is_valid(imageBin) and returns: True, False, False