

'''simple docstring'''






import inspect
import unittest

import requests

from transformers import MgpstrConfig
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
      import torch
      from torch import nn

      from transformers import MgpstrForSceneTextRecognition


if is_vision_available():
      from PIL import Image

      from transformers import MgpstrProcessor
class 	SCREAMING_SNAKE_CASE__			:




    def __init__(					self				,     lowercase__				,     lowercase__=False				,     lowercase__=13				,     lowercase__=(32, 128)				,     lowercase__=4				,     lowercase__=3				,     lowercase__=27				,     lowercase__=38				,     lowercase__=99				,     lowercase__=99				,     lowercase__=32				,     lowercase__=5				,     lowercase__=4				,     lowercase__=4.0				,     lowercase__=257				,     lowercase__=None				,     ):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			Union[str, Any]     =       parent
          SCREAMING_SNAKE_CASE_      :			Dict     =       is_training
          SCREAMING_SNAKE_CASE_      :			Tuple     =       batch_size
          SCREAMING_SNAKE_CASE_      :			List[Any]     =       image_size
          SCREAMING_SNAKE_CASE_      :			int     =       patch_size
          SCREAMING_SNAKE_CASE_      :			Optional[int]     =       num_channels
          SCREAMING_SNAKE_CASE_      :			List[Any]     =       max_token_length
          SCREAMING_SNAKE_CASE_      :			Union[str, Any]     =       num_character_labels
          SCREAMING_SNAKE_CASE_      :			Optional[Any]     =       num_bpe_labels
          SCREAMING_SNAKE_CASE_      :			List[Any]     =       num_wordpiece_labels
          SCREAMING_SNAKE_CASE_      :			Tuple     =       hidden_size
          SCREAMING_SNAKE_CASE_      :			List[Any]     =       num_hidden_layers
          SCREAMING_SNAKE_CASE_      :			Optional[int]     =       num_attention_heads
          SCREAMING_SNAKE_CASE_      :			List[str]     =       mlp_ratio
          SCREAMING_SNAKE_CASE_      :			Union[str, Any]     =       patch_embeds_hidden_size
          SCREAMING_SNAKE_CASE_      :			Union[str, Any]     =       output_hidden_states




    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			str     =       floats_tensor([self.batch_size, self.num_channels, self.image_size[0], self.image_size[1]]			)
          SCREAMING_SNAKE_CASE_      :			Any     =       self.get_config()
          return config, pixel_values




    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          return MgpstrConfig(
              image_size=self.image_size				,     patch_size=self.patch_size				,     num_channels=self.num_channels				,     max_token_length=self.max_token_length				,     num_character_labels=self.num_character_labels				,     num_bpe_labels=self.num_bpe_labels				,     num_wordpiece_labels=self.num_wordpiece_labels				,     hidden_size=self.hidden_size				,     num_hidden_layers=self.num_hidden_layers				,     num_attention_heads=self.num_attention_heads				,     mlp_ratio=self.mlp_ratio				,     output_hidden_states=self.output_hidden_states				,     )




    def   __lowerCamelCase      (					self				,     lowercase__				,     lowercase__			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			Any     =       MgpstrForSceneTextRecognition(lowercase__			)
          model.to(lowercase__			)
          model.eval()
          with torch.no_grad():
                SCREAMING_SNAKE_CASE_      :			List[str]     =       model(lowercase__			)
          self.parent.assertEqual(
              generated_ids[0][0].shape				,     (self.batch_size, self.max_token_length, self.num_character_labels)			)







    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			str     =       self.prepare_config_and_inputs()
          SCREAMING_SNAKE_CASE_      :			str     =       config_and_inputs
          SCREAMING_SNAKE_CASE_      :			Union[str, Any]     =       {'pixel_values': pixel_values}
          return config, inputs_dict






@require_torch
class 	SCREAMING_SNAKE_CASE__			(				a_,a_,unittest.TestCase      ):
    _A			    =							(MgpstrForSceneTextRecognition,) if is_torch_available() else ()
    _A			    =							{"feature-extraction": MgpstrForSceneTextRecognition} if is_torch_available() else {}
    _A			    =							False

    _A			    =							False
    _A			    =							False
    _A			    =							False
    _A			    =							False




    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			str     =       MgpstrModelTester(self			)
          SCREAMING_SNAKE_CASE_      :			List[Any]     =       ConfigTester(self				,     config_class=lowercase__				,     has_text_modality=lowercase__			)




    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          self.config_tester.run_common_tests()




    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			Optional[int]     =       self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_model(*lowercase__			)




    @unittest.skip(reason="MgpstrModel does not use inputs_embeds"			)
    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          pass




    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			int     =       self.model_tester.prepare_config_and_inputs_for_common()

          for model_class in self.all_model_classes:
                SCREAMING_SNAKE_CASE_      :			Optional[Any]     =       model_class(lowercase__			)
                self.assertIsInstance(model.get_input_embeddings()				,     (nn.Module)			)
                SCREAMING_SNAKE_CASE_      :			Union[str, Any]     =       model.get_output_embeddings()
                self.assertTrue(x is None or isinstance(lowercase__				,     nn.Linear			)			)




    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			Optional[Any]     =       self.model_tester.prepare_config_and_inputs_for_common()

          for model_class in self.all_model_classes:
                SCREAMING_SNAKE_CASE_      :			Optional[Any]     =       model_class(lowercase__			)
                SCREAMING_SNAKE_CASE_      :			Any     =       inspect.signature(model.forward			)
                # signature.parameters is an OrderedDict => so arg_names order is deterministic
                SCREAMING_SNAKE_CASE_      :			int     =       [*signature.parameters.keys()]

                SCREAMING_SNAKE_CASE_      :			Union[str, Any]     =       ['pixel_values']
                self.assertListEqual(arg_names[:1]				,     lowercase__			)




    @unittest.skip(reason="MgpstrModel does not support feedforward chunking"			)
    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          pass




    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			Optional[int]     =       self.model_tester.prepare_config_and_inputs_for_common()

          for model_class in self.all_model_classes:
                if not model_class.supports_gradient_checkpointing:
                      continue

                SCREAMING_SNAKE_CASE_      :			Optional[Any]     =       True
                SCREAMING_SNAKE_CASE_      :			Optional[int]     =       model_class(lowercase__			)
                self.assertTrue(model.is_gradient_checkpointing			)




    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          def check_hidden_states_output(lowercase__				,     lowercase__				,     lowercase__			):
                SCREAMING_SNAKE_CASE_      :			Union[str, Any]     =       model_class(lowercase__			)
                model.to(lowercase__			)
                model.eval()

                with torch.no_grad():
                      SCREAMING_SNAKE_CASE_      :			List[Any]     =       model(**self._prepare_for_class(lowercase__				,     lowercase__			)			)

                SCREAMING_SNAKE_CASE_      :			int     =       outputs.hidden_states

                SCREAMING_SNAKE_CASE_      :			Union[str, Any]     =       getattr(
                    self.model_tester				,     "expected_num_hidden_layers"				,     self.model_tester.num_hidden_layers + 1			)
                self.assertEqual(len(lowercase__			)				,     lowercase__			)

                self.assertListEqual(
                    list(hidden_states[0].shape[-2:]			)				,     [self.model_tester.patch_embeds_hidden_size, self.model_tester.hidden_size]				,     )

          SCREAMING_SNAKE_CASE_      :			Optional[int]     =       self.model_tester.prepare_config_and_inputs_for_common()

          for model_class in self.all_model_classes:
                SCREAMING_SNAKE_CASE_      :			Tuple     =       True
                check_hidden_states_output(lowercase__				,     lowercase__				,     lowercase__			)

                # check that output_hidden_states also work using config
                del inputs_dict["output_hidden_states"]
                SCREAMING_SNAKE_CASE_      :			Optional[Any]     =       True

                check_hidden_states_output(lowercase__				,     lowercase__				,     lowercase__			)




    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			Any     =       self.model_tester.prepare_config_and_inputs_for_common()

          SCREAMING_SNAKE_CASE_      :			Any     =       _config_zero_init(lowercase__			)
          for model_class in self.all_model_classes:
                SCREAMING_SNAKE_CASE_      :			int     =       model_class(config=lowercase__			)
                for name, param in model.named_parameters():
                      if isinstance(lowercase__				,     (nn.Linear, nn.Convad, nn.LayerNorm)			):
                            if param.requires_grad:
                                  self.assertIn(
                                      ((param.data.mean() * 1e9).round() / 1e9).item()				,     [0.0, 1.0]				,     msg=F"Parameter {name} of model {model_class} seems not properly initialized"				,     )







    @unittest.skip(reason="Retain_grad is tested in individual model tests"			)
    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          pass






def 					__lowerCamelCase			(      )							->   Optional[Any]:
      """simple docstring"""

      SCREAMING_SNAKE_CASE_      :			Optional[int]     =       'https://i.postimg.cc/ZKwLg2Gw/367-14.png'
      SCREAMING_SNAKE_CASE_      :			Any     =       Image.open(requests.get(SCREAMING_SNAKE_CASE_  ,  stream=SCREAMING_SNAKE_CASE_    ).raw    ).convert("RGB"    )
      return im





@require_vision
@require_torch
class 	SCREAMING_SNAKE_CASE__			(				unittest.TestCase      ):




    @slow
    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			Tuple     =       'alibaba-damo/mgp-str-base'
          SCREAMING_SNAKE_CASE_      :			Union[str, Any]     =       MgpstrForSceneTextRecognition.from_pretrained(lowercase__			).to(lowercase__			)
          SCREAMING_SNAKE_CASE_      :			str     =       MgpstrProcessor.from_pretrained(lowercase__			)

          SCREAMING_SNAKE_CASE_      :			Dict     =       prepare_img()
          SCREAMING_SNAKE_CASE_      :			Tuple     =       processor(images=lowercase__				,     return_tensors="pt"			).pixel_values.to(lowercase__			)

          # forward pass
          with torch.no_grad():
                SCREAMING_SNAKE_CASE_      :			int     =       model(lowercase__			)

          # verify the logits
          self.assertEqual(outputs.logits[0].shape				,     torch.Size((1, 27, 38)			)			)

          SCREAMING_SNAKE_CASE_      :			int     =       processor.batch_decode(outputs.logits			)
          SCREAMING_SNAKE_CASE_      :			int     =       'ticket'

          self.assertEqual(out_strs["generated_text"][0]				,     lowercase__			)

          SCREAMING_SNAKE_CASE_      :			Optional[Any]     =       torch.tensor(
              [[[-39.5397, -44.4024, -36.1844], [-61.4709, -63.8639, -58.3454], [-74.0225, -68.5494, -71.2164]]]				,     device=lowercase__				,     )

          self.assertTrue(torch.allclose(outputs.logits[0][:, 1:4, 1:4]				,     lowercase__				,     atol=1e-4			)			)





'''simple docstring'''







import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin


if is_torch_available():
   import torch

if is_vision_available():
   from PIL import Image

   from transformers import CLIPImageProcessor


class  __lowerCamelCase (       unittest.TestCase       ):
    """simple docstring"""


    def __init__(  self			:							Union[str, Any]      ,							SCREAMING_SNAKE_CASE			:							Any      ,							SCREAMING_SNAKE_CASE			:							List[str]=7      ,							SCREAMING_SNAKE_CASE			:							List[Any]=3      ,							SCREAMING_SNAKE_CASE			:							Dict=18      ,							SCREAMING_SNAKE_CASE			:							List[str]=30      ,							SCREAMING_SNAKE_CASE			:							List[Any]=400      ,							SCREAMING_SNAKE_CASE			:							int=True      ,							SCREAMING_SNAKE_CASE			:							Any=None      ,							SCREAMING_SNAKE_CASE			:							str=True      ,							SCREAMING_SNAKE_CASE			:							List[Any]=None      ,							SCREAMING_SNAKE_CASE			:							List[str]=True      ,							SCREAMING_SNAKE_CASE			:							Optional[int]=[0.4814_5466, 0.457_8275, 0.4082_1073]      ,							SCREAMING_SNAKE_CASE			:							Optional[Any]=[0.2686_2954, 0.2613_0258, 0.2757_7711]      ,							SCREAMING_SNAKE_CASE			:							Union[str, Any]=True      ,							):
           _A     :	List[Any]      =					size if size is not None else {'shortest_edge': 20}
           _A     :	List[Any]      =					crop_size if crop_size is not None else {'height': 18, 'width': 18}
           _A     :	Union[str, Any]      =					parent
           _A     :	Dict      =					batch_size
           _A     :	str      =					num_channels
           _A     :	int      =					image_size
           _A     :	Dict      =					min_resolution
           _A     :	Optional[Any]      =					max_resolution
           _A     :	int      =					do_resize
           _A     :	List[Any]      =					size
           _A     :	Any      =					do_center_crop
           _A     :	List[str]      =					crop_size
           _A     :	List[str]      =					do_normalize
           _A     :	Optional[int]      =					image_mean
           _A     :	Dict      =					image_std
           _A     :	Any      =					do_convert_rgb


    def    A    (  self			:							Tuple):
           return {
               "do_resize": self.do_resize,
               "size": self.size,
               "do_center_crop": self.do_center_crop,
               "crop_size": self.crop_size,
               "do_normalize": self.do_normalize,
               "image_mean": self.image_mean,
               "image_std": self.image_std,
               "do_convert_rgb": self.do_convert_rgb,
           }


    def    A    (  self			:							Any      ,							SCREAMING_SNAKE_CASE			:							str=False      ,							SCREAMING_SNAKE_CASE			:							str=False      ,							SCREAMING_SNAKE_CASE			:							List[Any]=False):
           assert not (numpify and torchify), "You cannot specify both numpy and PyTorch tensors at the same time"

           if equal_resolution:
                  _A     :	Union[str, Any]      =					[]
                  for i in range(self.batch_size):
                         image_inputs.append(
                             np.random.randint(
                                 255      ,							size=(self.num_channels, self.max_resolution, self.max_resolution)      ,							dtype=np.uinta))
           else:
                  _A     :	Union[str, Any]      =					[]
                  for i in range(self.batch_size):
                         _A  , _A     :	Optional[Any]      =					np.random.choice(np.arange(self.min_resolution      ,							self.max_resolution)      ,							2)
                         image_inputs.append(np.random.randint(255      ,							size=(self.num_channels, width, height)      ,							dtype=np.uinta))

           if not numpify and not torchify:
                  # PIL expects the channel dimension as last dimension
                  _A     :	List[str]      =					[Image.fromarray(np.moveaxis(SCREAMING_SNAKE_CASE      ,							0      ,							-1)) for x in image_inputs]

           if torchify:
                  _A     :	Optional[Any]      =					[torch.from_numpy(SCREAMING_SNAKE_CASE) for x in image_inputs]

           return image_inputs




@require_torch
@require_vision
class  __lowerCamelCase (       a_				,					unittest.TestCase       ):
    """simple docstring"""
    a													=    CLIPImageProcessor if is_vision_available() else None


    def    A    (  self			:							Dict):
           _A     :	Tuple      =					CLIPImageProcessingTester(self)


    @property
    def    A    (  self			:							Any):
           return self.image_processor_tester.prepare_image_processor_dict()


    def    A    (  self			:							List[str]):
           _A     :	Optional[int]      =					self.image_processing_class(**self.image_processor_dict)
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'do_resize'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'size'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'do_center_crop'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'center_crop'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'do_normalize'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'image_mean'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'image_std'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'do_convert_rgb'))


    def    A    (  self			:							Optional[int]):
           _A     :	Optional[Any]      =					self.image_processing_class.from_dict(self.image_processor_dict)
           self.assertEqual(image_processor.size      ,							{'shortest_edge': 20})
           self.assertEqual(image_processor.crop_size      ,							{'height': 18, 'width': 18})

           _A     :	Optional[int]      =					self.image_processing_class.from_dict(self.image_processor_dict      ,							size=42      ,							crop_size=84)
           self.assertEqual(image_processor.size      ,							{'shortest_edge': 42})
           self.assertEqual(image_processor.crop_size      ,							{'height': 84, 'width': 84})


    def    A    (  self			:							List[str]):
           pass


    def    A    (  self			:							Optional[int]):
           # Initialize image_processing
           _A     :	Any      =					self.image_processing_class(**self.image_processor_dict)
           # create random PIL images
           _A     :	List[Any]      =					self.image_processor_tester.prepare_inputs(equal_resolution=SCREAMING_SNAKE_CASE)
           for image in image_inputs:
                  self.assertIsInstance(SCREAMING_SNAKE_CASE      ,							Image.Image)

           # Test not batched input
           _A     :	List[str]      =					image_processing(image_inputs[0]      ,							return_tensors='pt').pixel_values
           self.assertEqual(
               encoded_images.shape      ,							(
                   1,
                   self.image_processor_tester.num_channels,
                   self.image_processor_tester.crop_size['height'],
                   self.image_processor_tester.crop_size['width'],
               )      ,							)

           # Test batched
           _A     :	List[str]      =					image_processing(SCREAMING_SNAKE_CASE      ,							return_tensors='pt').pixel_values
           self.assertEqual(
               encoded_images.shape      ,							(
                   self.image_processor_tester.batch_size,
                   self.image_processor_tester.num_channels,
                   self.image_processor_tester.crop_size['height'],
                   self.image_processor_tester.crop_size['width'],
               )      ,							)


    def    A    (  self			:							Dict):
           # Initialize image_processing
           _A     :	Optional[int]      =					self.image_processing_class(**self.image_processor_dict)
           # create random numpy tensors
           _A     :	Tuple      =					self.image_processor_tester.prepare_inputs(equal_resolution=SCREAMING_SNAKE_CASE      ,							numpify=SCREAMING_SNAKE_CASE)
           for image in image_inputs:
                  self.assertIsInstance(SCREAMING_SNAKE_CASE      ,							np.ndarray)

           # Test not batched input
           _A     :	Dict      =					image_processing(image_inputs[0]      ,							return_tensors='pt').pixel_values
           self.assertEqual(
               encoded_images.shape      ,							(
                   1,
                   self.image_processor_tester.num_channels,
                   self.image_processor_tester.crop_size['height'],
                   self.image_processor_tester.crop_size['width'],
               )      ,							)

           # Test batched
           _A     :	Tuple      =					image_processing(SCREAMING_SNAKE_CASE      ,							return_tensors='pt').pixel_values
           self.assertEqual(
               encoded_images.shape      ,							(
                   self.image_processor_tester.batch_size,
                   self.image_processor_tester.num_channels,
                   self.image_processor_tester.crop_size['height'],
                   self.image_processor_tester.crop_size['width'],
               )      ,							)


    def    A    (  self			:							str):
           # Initialize image_processing
           _A     :	Optional[Any]      =					self.image_processing_class(**self.image_processor_dict)
           # create random PyTorch tensors
           _A     :	Tuple      =					self.image_processor_tester.prepare_inputs(equal_resolution=SCREAMING_SNAKE_CASE      ,							torchify=SCREAMING_SNAKE_CASE)
           for image in image_inputs:
                  self.assertIsInstance(SCREAMING_SNAKE_CASE      ,							torch.Tensor)

           # Test not batched input
           _A     :	Any      =					image_processing(image_inputs[0]      ,							return_tensors='pt').pixel_values
           self.assertEqual(
               encoded_images.shape      ,							(
                   1,
                   self.image_processor_tester.num_channels,
                   self.image_processor_tester.crop_size['height'],
                   self.image_processor_tester.crop_size['width'],
               )      ,							)

           # Test batched
           _A     :	Union[str, Any]      =					image_processing(SCREAMING_SNAKE_CASE      ,							return_tensors='pt').pixel_values
           self.assertEqual(
               encoded_images.shape      ,							(
                   self.image_processor_tester.batch_size,
                   self.image_processor_tester.num_channels,
                   self.image_processor_tester.crop_size['height'],
                   self.image_processor_tester.crop_size['width'],
               )      ,							)




@require_torch
@require_vision
class  __lowerCamelCase (       a_				,					unittest.TestCase       ):
    """simple docstring"""
    a													=    CLIPImageProcessor if is_vision_available() else None


    def    A    (  self			:							int):
           _A     :	Union[str, Any]      =					CLIPImageProcessingTester(self      ,							num_channels=4)
           _A     :	Dict      =					3


    @property
    def    A    (  self			:							Any):
           return self.image_processor_tester.prepare_image_processor_dict()


    def    A    (  self			:							str):
           _A     :	str      =					self.image_processing_class(**self.image_processor_dict)
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'do_resize'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'size'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'do_center_crop'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'center_crop'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'do_normalize'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'image_mean'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'image_std'))
           self.assertTrue(hasattr(SCREAMING_SNAKE_CASE      ,							'do_convert_rgb'))


    def    A    (  self			:							str):
           pass


    def    A    (  self			:							int):
           # Initialize image_processing
           _A     :	List[Any]      =					self.image_processing_class(**self.image_processor_dict)
           # create random PIL images
           _A     :	Union[str, Any]      =					self.image_processor_tester.prepare_inputs(equal_resolution=SCREAMING_SNAKE_CASE)
           for image in image_inputs:
                  self.assertIsInstance(SCREAMING_SNAKE_CASE      ,							Image.Image)

           # Test not batched input
           _A     :	int      =					image_processing(image_inputs[0]      ,							return_tensors='pt').pixel_values
           self.assertEqual(
               encoded_images.shape      ,							(
                   1,
                   self.expected_encoded_image_num_channels,
                   self.image_processor_tester.crop_size['height'],
                   self.image_processor_tester.crop_size['width'],
               )      ,							)

           # Test batched
           _A     :	str      =					image_processing(SCREAMING_SNAKE_CASE      ,							return_tensors='pt').pixel_values
           self.assertEqual(
               encoded_images.shape      ,							(
                   self.image_processor_tester.batch_size,
                   self.expected_encoded_image_num_channels,
                   self.image_processor_tester.crop_size['height'],
                   self.image_processor_tester.crop_size['width'],
               )      ,							)






