class_docstr: A text detector using the CRNN architecture.
  
  Args:
      alphabet: The alphabet the model should recognize.
      build_params: A dictionary of build parameters for the model.
          See `keras_ocr.recognition.build_model` for details.
      weights: The starting weight configuration for the model.
      include_top: Whether to include the final classification layer in the model (set
          to False to use a custom alphabet).
class_docstr_tok: ["A","text","detector","using","the","CRNN","architecture",".","Args",":","alphabet",":","The","alphabet","the","model","should","recognize",".","build_params",":","A","dictionary","of","build","parameters","for","the","model",".","See","`","keras_ocr.recognition.build_model","`","for","details",".","weights",":","The","starting","weight","configuration","for","the","model",".","include_top",":","Whether","to","include","the","final","classification","layer","in","the","model","(","set","to","False","to","use","a","custom","alphabet",")","."]
code: def __init__(
      self, alphabet=None, weights="kurapan", build_params=None
  ):
      assert (
          alphabet or weights
      ), "At least one of alphabet or weights must be provided."
      if weights is not None:
          build_params = (
              build_params
              or PRETRAINED_WEIGHTS[weights]["build_params"]
          )
          alphabet = alphabet or PRETRAINED_WEIGHTS[weights]["alphabet"]
      build_params = build_params or DEFAULT_BUILD_PARAMS
      if alphabet is None:
          alphabet = DEFAULT_ALPHABET
      self.alphabet = alphabet
      self.blank_label_idx = len(alphabet)
      (
          self.backbone,
          self.model,
          self.training_model,
          self.prediction_model,
      ) = build_model(alphabet=alphabet, **build_params)
      if weights is not None:
          weights_dict = PRETRAINED_WEIGHTS[weights]
          if alphabet == weights_dict["alphabet"]:
              self.model.load_weights(
                  tools.download_and_verify(
                      url=weights_dict["weights"]["top"]["url"],
                      filename=weights_dict["weights"]["top"][
                          "filename"
                      ],
                      sha256=weights_dict["weights"]["top"]["sha256"],
                  )
              )
          else:
              print(
                  "Provided alphabet does not match pretrained alphabet. "
                  "Using backbone weights only."
              )
              self.backbone.load_weights(
                  tools.download_and_verify(
                      url=weights_dict["weights"]["notop"]["url"],
                      filename=weights_dict["weights"]["notop"][
                          "filename"
                      ],
                      sha256=weights_dict["weights"]["notop"]["sha256"],
                  )
              )
  
file_path: keras-ocr/keras_ocr/recognition.py
imports: import typing
  import string
  import tensorflow
  from tensorflow import keras
  import numpy
  import cv2
  from .None import tools
label_desc: Use image node_id 1 to create a new Recognizer object  with example: obj = Recognizer(alphabet, weights, build_params)