Add ViTImageProcessorFast to tests (#31424)

* Add ViTImageProcessor to tests

* Correct data format

* Review comments
This commit is contained in:
amyeroberts
2024-06-25 13:36:58 +01:00
committed by GitHub
parent aab0829790
commit 0f67ba1d74
26 changed files with 230 additions and 87 deletions

View File

@@ -232,7 +232,7 @@ class Pix2StructImageProcessingTest(ImageProcessingTestMixin, unittest.TestCase)
for max_patch in self.image_processor_tester.max_patches:
# Test not batched input
encoded_images = image_processor(
image_inputs[0], return_tensors="pt", max_patches=max_patch, input_data_format="channels_first"
image_inputs[0], return_tensors="pt", max_patches=max_patch, input_data_format="channels_last"
).flattened_patches
self.assertEqual(
encoded_images.shape,
@@ -241,7 +241,7 @@ class Pix2StructImageProcessingTest(ImageProcessingTestMixin, unittest.TestCase)
# Test batched
encoded_images = image_processor(
image_inputs, return_tensors="pt", max_patches=max_patch, input_data_format="channels_first"
image_inputs, return_tensors="pt", max_patches=max_patch, input_data_format="channels_last"
).flattened_patches
self.assertEqual(
encoded_images.shape,