code: def resize(image, checkpoint_url):
      width, height = image.size
      current_max_size = max(width, height)
      target_max_size = 800 if "detection" in checkpoint_url else 1000
      scale = target_max_size / current_max_size
      resized_image = image.resize(
          (int(round(scale * width)), int(round(scale * height)))
      )
  
      return resized_image
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/table_transformer/convert_table_transformer_original_pytorch_checkpoint_to_pytorch.py
imports: import argparse
  from collections import OrderedDict
  from pathlib import Path
  import torch
  from PIL import Image
  from torchvision.transforms import functional
  from huggingface_hub import hf_hub_download
  from transformers import DetrFeatureExtractor, TableTransformerConfig, TableTransformerForObjectDetection
  from transformers.utils import logging
label_desc: Use image node_id 4 for calling a global function with example usage: resize(image, checkpoint_url) and returns: resized_image