code: def test_rotated_detectionpredictor(mock_pdf):
      batch_size = 4
      predictor = DetectionPredictor(
          PreProcessor(output_size=(512, 512), batch_size=batch_size),
          detection.db_resnet50(
              assume_straight_pages=False, input_shape=(512, 512, 3)
          ),
      )
  
      pages = DocumentFile.from_pdf(mock_pdf).as_images()
      out = predictor(pages)
  
      # The input PDF has 2 pages
      assert len(out) == 2
  
      # Dimension check
      with pytest.raises(ValueError):
          input_page = (255 * np.random.rand(1, 256, 512, 3)).astype(
              np.uint8
          )
          _ = predictor([input_page])
  
      return predictor
  
imports: import os
  import tempfile
  import numpy
  import onnxruntime
  import psutil
  import pytest
  import tensorflow
  from doctr.file_utils import CLASS_NAME
  from doctr.io import DocumentFile
  from doctr.models import detection
  from doctr.models.detection._utils import dilate, erode
  from doctr.models.detection.predictor import DetectionPredictor
  from doctr.models.preprocessor import PreProcessor
  from doctr.models.utils import export_model_to_onnx
label_desc: Use image node_id 3 for calling a global function with example usage: test_rotated_detectionpredictor(mock_pdf) and returns: predictor