code: def __call__(self, img, cls=True):
      time_dict = {"det": 0, "rec": 0, "cls": 0, "all": 0}
  
      if img is None:
          logger.debug("no valid image provided")
          return None, None, time_dict
  
      start = time.time()
      ori_im = img.copy()
      dt_boxes, elapse = self.text_detector(img)
      time_dict["det"] = elapse
  
      if dt_boxes is None:
          logger.debug("no dt_boxes found, elapsed : {}".format(elapse))
          end = time.time()
          time_dict["all"] = end - start
          return None, None, time_dict
      else:
          logger.debug(
              "dt_boxes num : {}, elapsed : {}".format(
                  len(dt_boxes), elapse
              )
          )
      img_crop_list = []
  
      dt_boxes = sorted_boxes(dt_boxes)
  
      for bno in range(len(dt_boxes)):
          tmp_box = copy.deepcopy(dt_boxes[bno])
          if self.args.det_box_type == "quad":
              img_crop = get_rotate_crop_image(ori_im, tmp_box)
          else:
              img_crop = get_minarea_rect_crop(ori_im, tmp_box)
          img_crop_list.append(img_crop)
      if self.use_angle_cls and cls:
          img_crop_list, angle_list, elapse = self.text_classifier(
              img_crop_list
          )
          time_dict["cls"] = elapse
          logger.debug(
              "cls num  : {}, elapsed : {}".format(
                  len(img_crop_list), elapse
              )
          )
  
      rec_res, elapse = self.text_recognizer(img_crop_list)
      time_dict["rec"] = elapse
      logger.debug(
          "rec_res num  : {}, elapsed : {}".format(len(rec_res), elapse)
      )
      if self.args.save_crop_res:
          self.draw_crop_rec_res(
              self.args.crop_res_save_dir, img_crop_list, rec_res
          )
      filter_boxes, filter_rec_res = [], []
      for box, rec_result in zip(dt_boxes, rec_res):
          text, score = rec_result
          if score >= self.drop_score:
              filter_boxes.append(box)
              filter_rec_res.append(rec_result)
      end = time.time()
      time_dict["all"] = end - start
      return filter_boxes, filter_rec_res, time_dict
  
imports: import os
  import sys
  import subprocess
  import cv2
  import copy
  import numpy
  import json
  import time
  import logging
  from PIL import Image
  import tools.infer.utility
  import tools.infer.predict_rec
  import tools.infer.predict_det
  import tools.infer.predict_cls
  from ppocr.utils.utility import get_image_file_list, check_and_read
  from ppocr.utils.logging import get_logger
  from tools.infer.utility import draw_ocr_box_txt, get_rotate_crop_image, get_minarea_rect_crop
label_desc: Use image node_id 3 for calling the TextSystem obj's underlying member method code with example usage: obj.__call__(img, cls) and returns: filter_boxes,  filter_rec_res,  time_dict, None,  None,  time_dict, None,  None,  time_dict