docstr: This function computes the expected height and width when providing images to ViltImageProcessor,
  assuming do_resize is set to True with a scalar size and size_divisor.
docstr_tok: ["This","function","computes","the","expected","height","and","width","when","providing","images","to","ViltImageProcessor",",","assuming","do_resize","is","set","to","True","with","a","scalar","size","and","size_divisor","."]
code: def get_expected_values(self, image_inputs, batched=False):
      """
      This function computes the expected height and width when providing images to ViltImageProcessor,
      assuming do_resize is set to True with a scalar size and size_divisor.
      """
      if not batched:
          size = self.size["shortest_edge"]
          image = image_inputs[0]
          if isinstance(image, Image.Image):
              w, h = image.size
          else:
              h, w = image.shape[1], image.shape[2]
          scale = size / min(w, h)
          if h < w:
              newh, neww = size, scale * w
          else:
              newh, neww = scale * h, size
  
          max_size = int((1333 / 800) * size)
          if max(newh, neww) > max_size:
              scale = max_size / max(newh, neww)
              newh = newh * scale
              neww = neww * scale
  
          newh, neww = int(newh + 0.5), int(neww + 0.5)
          expected_height, expected_width = (
              newh // self.size_divisor * self.size_divisor,
              neww // self.size_divisor * self.size_divisor,
          )
  
      else:
          expected_values = []
          for image in image_inputs:
              (
                  expected_height,
                  expected_width,
              ) = self.get_expected_values([image])
              expected_values.append((expected_height, expected_width))
          expected_height = max(
              expected_values, key=lambda item: item[0]
          )[0]
          expected_width = max(
              expected_values, key=lambda item: item[1]
          )[1]
  
      return expected_height, expected_width
  
file_path: transformers/tests/models/vilt/test_image_processing_vilt.py
imports: import unittest
  from transformers.testing_utils import require_torch, require_vision
  from transformers.utils import is_vision_available
  from ...test_image_processing_common import ImageProcessingTestMixin, prepare_image_inputs
label_desc: Use image node_id 3 for calling the ViltImageProcessingTester obj's underlying member method code with example usage: obj.get_expected_values(image_inputs, batched) and returns: expected_height,  expected_width