code: def _crop_orientation_predictor(
      arch: str, pretrained: bool, **kwargs: Any
  ) -> CropOrientationPredictor:
      if arch not in ORIENTATION_ARCHS:
          raise ValueError(f"unknown architecture '{arch}'")
  
      # Load directly classifier from backbone
      _model = classification.__dict__[arch](pretrained=pretrained)
      kwargs["mean"] = kwargs.get("mean", _model.cfg["mean"])
      kwargs["std"] = kwargs.get("std", _model.cfg["std"])
      kwargs["batch_size"] = kwargs.get("batch_size", 64)
      input_shape = (
          _model.cfg["input_shape"][:-1]
          if is_tf_available()
          else _model.cfg["input_shape"][1:]
      )
      predictor = CropOrientationPredictor(
          PreProcessor(
              input_shape,
              preserve_aspect_ratio=True,
              symmetric_pad=True,
              **kwargs,
          ),
          _model,
      )
      return predictor
  
imports: from typing import Any, List
  from doctr.file_utils import is_tf_available
  from ..None import classification
  from ..preprocessor import PreProcessor
  from .predictor import CropOrientationPredictor
label_desc: Use image node_id 1 for calling a global function with example usage: _crop_orientation_predictor(arch, pretrained) and returns: predictor