code: def get_inference_data(page, page_blocks: Page):
      bboxes = deepcopy([block.bbox for block in page_blocks.blocks])
      words = ["."] * len(bboxes)
  
      pix = page.get_pixmap(
          dpi=settings.LAYOUT_DPI, annots=False, clip=page_blocks.bbox
      )
      png = pix.pil_tobytes(format="PNG")
      rgb_image = Image.open(io.BytesIO(png)).convert("RGB")
  
      page_box = page_blocks.bbox
      pwidth = page_blocks.width
      pheight = page_blocks.height
  
      for box in bboxes:
          if box[0] < page_box[0]:
              box[0] = page_box[0]
          if box[1] < page_box[1]:
              box[1] = page_box[1]
          if box[2] > page_box[2]:
              box[2] = page_box[2]
          if box[3] > page_box[3]:
              box[3] = page_box[3]
  
          box[0] = int(box[0] / pwidth * 1000)
          box[1] = int(box[1] / pheight * 1000)
          box[2] = int(box[2] / pwidth * 1000)
          box[3] = int(box[3] / pheight * 1000)
  
      return rgb_image, bboxes, words
  
file_path: pdf-to-markdown/marker/ordering.py
imports: from copy import deepcopy
  from typing import List
  import torch
  import sys, os
  from marker.extract_text import convert_single_page
  from transformers import LayoutLMv3ForSequenceClassification, LayoutLMv3Processor
  from PIL import Image
  import io
  from marker.schema import Page
  from marker.settings import settings
label_desc: Use image node_id 2 for calling a global function with example usage: get_inference_data(page, page_blocks) and returns: rgb_image,  bboxes,  words