


from __future__ import annotations

import collections
import tempfile
import unittest

import numpy as np

from transformers.testing_utils import require_tf, require_vision, slow
from transformers.utils import is_tf_available, is_vision_available

from ...test_modeling_tf_common import floats_tensor, ids_tensor, random_attention_mask
from ..bert.test_modeling_tf_bert import TFBertModelTester
from ..clip.test_modeling_tf_clip import TFCLIPVisionModelTester
from ..deit.test_modeling_tf_deit import TFDeiTModelTester
from ..roberta.test_modeling_tf_roberta import TFRobertaModelTester
from ..vit.test_modeling_tf_vit import TFViTModelTester


if is_tf_available():
    from transformers import (
        TFBertModel,
        TFCLIPVisionModel,
        TFDeiTModel,
        TFRobertaModel,
        TFVisionTextDualEncoderModel,
        TFViTModel,
        VisionTextDualEncoderConfig,
    )

if is_vision_available():
    from PIL import Image

    from transformers import VisionTextDualEncoderProcessor






def 						_A						(						_lowercase      ) ->      int:


     """simple docstring"""


     if isinstance(A__ ,   collections.abc.Iterable      ):
          return x
     return (x, x)



@require_tf
class      __lowerCamelCase       :







       def 						snake_case_     (       self:      int,A_:      str,A_:      int ):






            '''simple docstring'''




            pass







       def 						snake_case_     (       self:      Union[str, Any] ):






            '''simple docstring'''




            pass







       def 						snake_case_     (       self:      Any ):






            '''simple docstring'''




            pass







       def 						snake_case_     (       self:      int,A_:      List[str],A_:      str,A_:      Dict,A_:      List[str],A_:      Optional[Any]=None,**A_:      List[Any] ):






            '''simple docstring'''




            __UpperCamelCase      =       VisionTextDualEncoderConfig.from_vision_text_configs(A_,A_ )

            __UpperCamelCase      =       TFVisionTextDualEncoderModel(A_ )

            __UpperCamelCase      =       model(input_ids=A_,pixel_values=A_,attention_mask=A_ )

            self.assertEqual(output['text_embeds'].shape,(input_ids.shape[0], config.projection_dim) )
            self.assertEqual(output['image_embeds'].shape,(pixel_values.shape[0], config.projection_dim) )







       def 						snake_case_     (       self:      Dict,A_:      Any,A_:      Optional[Any],A_:      Tuple,A_:      int,A_:      Optional[Any]=None,**A_:      Any ):






            '''simple docstring'''




            __UpperCamelCase      =       self.get_vision_text_model(A_,A_ )
            __UpperCamelCase      =       TFVisionTextDualEncoderModel(vision_model=A_,text_model=A_ )

            __UpperCamelCase      =       model(input_ids=A_,pixel_values=A_,attention_mask=A_ )

            self.assertEqual(output['text_embeds'].shape,(input_ids.shape[0], model.config.projection_dim) )
            self.assertEqual(output['image_embeds'].shape,(pixel_values.shape[0], model.config.projection_dim) )







       def 						snake_case_     (       self:      Dict,A_:      Any,A_:      List[Any],A_:      List[str],A_:      Dict,A_:      Any=None,**A_:      str ):






            '''simple docstring'''




            __UpperCamelCase      =       self.get_vision_text_model(A_,A_ )
            __UpperCamelCase      =       {"""vision_model""": vision_model, """text_model""": text_model}
            __UpperCamelCase      =       TFVisionTextDualEncoderModel.from_vision_text_pretrained(**A_ )

            __UpperCamelCase      =       model(input_ids=A_,pixel_values=A_,attention_mask=A_ )

            self.assertEqual(output['text_embeds'].shape,(input_ids.shape[0], model.config.projection_dim) )
            self.assertEqual(output['image_embeds'].shape,(pixel_values.shape[0], model.config.projection_dim) )







       def 						snake_case_     (       self:      Optional[int],A_:      Union[str, Any],A_:      Union[str, Any],A_:      Any,A_:      Union[str, Any],A_:      Dict=None,**A_:      Dict ):






            '''simple docstring'''




            __UpperCamelCase      =       self.get_vision_text_model(A_,A_ )
            __UpperCamelCase      =       TFVisionTextDualEncoderModel(vision_model=A_,text_model=A_ )

            __UpperCamelCase      =       model(input_ids=A_,pixel_values=A_,attention_mask=A_ )
            __UpperCamelCase      =       output[0].numpy()

            with tempfile.TemporaryDirectory() as tmpdirname:
                 model.save_pretrained(A_ )
                 __UpperCamelCase      =       TFVisionTextDualEncoderModel.from_pretrained(A_ )

                 __UpperCamelCase      =       model(input_ids=A_,pixel_values=A_,attention_mask=A_ )
                 __UpperCamelCase      =       after_output[0].numpy()
                 __UpperCamelCase      =       np.amax(np.abs(out_a - out_a ) )
                 self.assertLessEqual(A_,1E-5 )







       def 						snake_case_     (       self:      int,A_:      Any,A_:      List[str],A_:      List[Any],A_:      Dict,A_:      Dict=None,**A_:      List[Any] ):






            '''simple docstring'''




            __UpperCamelCase      =       self.get_vision_text_model(A_,A_ )
            __UpperCamelCase      =       TFVisionTextDualEncoderModel(vision_model=A_,text_model=A_ )

            __UpperCamelCase      =       model(
                input_ids=A_,pixel_values=A_,attention_mask=A_,output_attentions=A_ )

            __UpperCamelCase      =       output.vision_model_output.attentions
            self.assertEqual(len(A_ ),vision_config.num_hidden_layers )

            # in ViT, the seq_len equals the number of patches + 1 (we add 1 for the [CLS] token)
            __UpperCamelCase      =       to_atuple(vision_model.config.image_size )
            __UpperCamelCase      =       to_atuple(vision_model.config.patch_size )
            __UpperCamelCase      =       (image_size[1] // patch_size[1]) * (image_size[0] // patch_size[0])
            __UpperCamelCase      =       num_patches + 1
            self.assertEqual(vision_attentions[0].shape[-3:],(vision_config.num_attention_heads, seq_len, seq_len) )

            __UpperCamelCase      =       output.text_model_output.attentions
            self.assertEqual(len(A_ ),text_config.num_hidden_layers )

            self.assertEqual(
                text_attentions[0].shape[-3:],(text_config.num_attention_heads, input_ids.shape[-1], input_ids.shape[-1]),)







       def 						snake_case_     (       self:      List[str],A_:      np.ndarray,A_:      np.ndarray,A_:      float ):






            '''simple docstring'''




            __UpperCamelCase      =       np.abs((a - b) ).max()
            self.assertLessEqual(A_,A_,F'''Difference between torch and flax is {diff} (>= {tol}).''' )







       def 						snake_case_     (       self:      List[Any] ):






            '''simple docstring'''




            __UpperCamelCase      =       self.prepare_config_and_inputs()
            self.check_vision_text_dual_encoder_model(**A_ )







       def 						snake_case_     (       self:      List[str] ):






            '''simple docstring'''




            __UpperCamelCase      =       self.prepare_config_and_inputs()
            self.check_model_from_pretrained_configs(**A_ )







       def 						snake_case_     (       self:      List[Any] ):






            '''simple docstring'''




            __UpperCamelCase      =       self.prepare_config_and_inputs()
            self.check_vision_text_dual_encoder_from_pretrained(**A_ )







       def 						snake_case_     (       self:      str ):






            '''simple docstring'''




            __UpperCamelCase      =       self.prepare_config_and_inputs()
            self.check_save_load(**A_ )







       def 						snake_case_     (       self:      Tuple ):






            '''simple docstring'''




            __UpperCamelCase      =       self.prepare_config_and_inputs()
            self.check_vision_text_output_attention(**A_ )







       @slow
       def 						snake_case_     (       self:      Optional[Any] ):






            '''simple docstring'''




            __UpperCamelCase      =       self.get_pretrained_model_and_inputs()

            __UpperCamelCase      =       model_a(**A_ )
            __UpperCamelCase      =       outputs[0].numpy()

            with tempfile.TemporaryDirectory() as tmp_dirname:
                 model_a.save_pretrained(A_ )
                 __UpperCamelCase      =       TFVisionTextDualEncoderModel.from_pretrained(A_ )

                 __UpperCamelCase      =       model_a(**A_ )
                 __UpperCamelCase      =       after_outputs[0].numpy()
                 __UpperCamelCase      =       np.amax(np.abs(out_a - out_a ) )
                 self.assertLessEqual(A_,1E-5 )



@require_tf
class      __lowerCamelCase       (_SCREAMING_SNAKE_CASE							,	unittest.TestCase		):







       def 						snake_case_     (       self:      Optional[Any] ):






            '''simple docstring'''




            __UpperCamelCase      =       TFVisionTextDualEncoderModel.from_vision_text_pretrained(
                'hf-internal-testing/tiny-random-vit','hf-internal-testing/tiny-random-bert' )
            __UpperCamelCase      =       13
            __UpperCamelCase      =       floats_tensor(
                [
                    batch_size,
                    model.vision_model.config.num_channels,
                    model.vision_model.config.image_size,
                    model.vision_model.config.image_size,
                ] )
            __UpperCamelCase      =       ids_tensor([batch_size, 4],model.text_model.config.vocab_size )
            __UpperCamelCase      =       random_attention_mask([batch_size, 4] )
            __UpperCamelCase      =       {"""pixel_values""": pixel_values, """input_ids""": input_ids, """attention_mask""": attention_mask}

            return model, inputs







       def 						snake_case_     (       self:      Tuple,A_:      List[str],A_:      Optional[Any] ):






            '''simple docstring'''




            __UpperCamelCase      =       TFViTModel(A_,name='vision_model' )
            __UpperCamelCase      =       TFBertModel(A_,name='text_model' )
            return vision_model, text_model







       def 						snake_case_     (       self:      List[Any] ):






            '''simple docstring'''




            __UpperCamelCase      =       TFViTModelTester(self )
            __UpperCamelCase      =       TFBertModelTester(self )
            __UpperCamelCase      =       vit_model_tester.prepare_config_and_inputs()
            __UpperCamelCase      =       bert_model_tester.prepare_config_and_inputs()

            __UpperCamelCase      =       vision_config_and_inputs

            (
                __UpperCamelCase							
            )      =       text_config_and_inputs

            return {
                "text_config": text_config,
                "vision_config": vision_config,
                "pixel_values": pixel_values,
                "attention_mask": input_mask,
                "input_ids": input_ids,
                "text_token_type_ids": token_type_ids,
                "text_sequence_labels": sequence_labels,
                "text_token_labels": token_labels,
                "text_choice_labels": choice_labels,
            }



@require_tf
class      __lowerCamelCase       (_SCREAMING_SNAKE_CASE							,	unittest.TestCase		):







       def 						snake_case_     (       self:      Dict ):






            '''simple docstring'''




            __UpperCamelCase      =       TFVisionTextDualEncoderModel.from_vision_text_pretrained(
                'Rocketknight1/tiny-random-deit-tf','hf-internal-testing/tiny-random-roberta' )
            __UpperCamelCase      =       13
            __UpperCamelCase      =       floats_tensor(
                [
                    batch_size,
                    model.vision_model.config.num_channels,
                    model.vision_model.config.image_size,
                    model.vision_model.config.image_size,
                ] )
            __UpperCamelCase      =       ids_tensor([batch_size, 4],model.text_model.config.vocab_size )
            __UpperCamelCase      =       random_attention_mask([batch_size, 4] )
            __UpperCamelCase      =       {"""pixel_values""": pixel_values, """input_ids""": input_ids, """attention_mask""": attention_mask}

            return model, inputs







       def 						snake_case_     (       self:      Optional[Any],A_:      Union[str, Any],A_:      List[str],A_:      Tuple,A_:      Optional[int],A_:      List[Any]=None,**A_:      Dict ):






            '''simple docstring'''




            __UpperCamelCase      =       self.get_vision_text_model(A_,A_ )
            __UpperCamelCase      =       TFVisionTextDualEncoderModel(vision_model=A_,text_model=A_ )

            __UpperCamelCase      =       model(
                input_ids=A_,pixel_values=A_,attention_mask=A_,output_attentions=A_ )

            __UpperCamelCase      =       output.vision_model_output.attentions
            self.assertEqual(len(A_ ),vision_config.num_hidden_layers )

            # in DEiT, the seq_len equals the number of patches + 2 (we add 2 for the [CLS] and distillation tokens)
            __UpperCamelCase      =       to_atuple(vision_model.config.image_size )
            __UpperCamelCase      =       to_atuple(vision_model.config.patch_size )
            __UpperCamelCase      =       (image_size[1] // patch_size[1]) * (image_size[0] // patch_size[0])
            __UpperCamelCase      =       num_patches + 2
            self.assertEqual(vision_attentions[0].shape[-3:],(vision_config.num_attention_heads, seq_len, seq_len) )

            __UpperCamelCase      =       output.text_model_output.attentions
            self.assertEqual(len(A_ ),text_config.num_hidden_layers )

            self.assertEqual(
                text_attentions[0].shape[-3:],(text_config.num_attention_heads, input_ids.shape[-1], input_ids.shape[-1]),)







       def 						snake_case_     (       self:      Dict,A_:      int,A_:      Optional[int] ):






            '''simple docstring'''




            __UpperCamelCase      =       TFDeiTModel(A_,name='vision_model' )
            __UpperCamelCase      =       TFRobertaModel(A_,name='text_model' )
            return vision_model, text_model







       def 						snake_case_     (       self:      Tuple ):






            '''simple docstring'''




            __UpperCamelCase      =       TFDeiTModelTester(self )
            __UpperCamelCase      =       TFRobertaModelTester(self )
            __UpperCamelCase      =       vit_model_tester.prepare_config_and_inputs()
            __UpperCamelCase      =       bert_model_tester.prepare_config_and_inputs()

            __UpperCamelCase      =       vision_config_and_inputs

            (
                __UpperCamelCase							
            )      =       text_config_and_inputs

            return {
                "text_config": text_config,
                "vision_config": vision_config,
                "pixel_values": pixel_values,
                "attention_mask": input_mask,
                "input_ids": input_ids,
                "text_token_type_ids": token_type_ids,
                "text_sequence_labels": sequence_labels,
                "text_token_labels": token_labels,
                "text_choice_labels": choice_labels,
            }



@require_tf
class      __lowerCamelCase       (_SCREAMING_SNAKE_CASE							,	unittest.TestCase		):







       def 						snake_case_     (       self:      List[str] ):






            '''simple docstring'''




            __UpperCamelCase      =       TFVisionTextDualEncoderModel.from_vision_text_pretrained(
                'Rocketknight1/tiny-random-clip-tf','hf-internal-testing/tiny-random-bert' )
            __UpperCamelCase      =       13
            __UpperCamelCase      =       floats_tensor(
                [
                    batch_size,
                    model.vision_model.config.num_channels,
                    model.vision_model.config.image_size,
                    model.vision_model.config.image_size,
                ] )
            __UpperCamelCase      =       ids_tensor([batch_size, 4],model.text_model.config.vocab_size )
            __UpperCamelCase      =       random_attention_mask([batch_size, 4] )
            __UpperCamelCase      =       {"""pixel_values""": pixel_values, """input_ids""": input_ids, """attention_mask""": attention_mask}

            return model, inputs







       def 						snake_case_     (       self:      Optional[int],A_:      Any,A_:      Any ):






            '''simple docstring'''




            __UpperCamelCase      =       TFCLIPVisionModel(A_,name='vision_model' )
            __UpperCamelCase      =       TFBertModel(A_,name='text_model' )
            return vision_model, text_model







       def 						snake_case_     (       self:      List[Any] ):






            '''simple docstring'''




            __UpperCamelCase      =       TFCLIPVisionModelTester(self )
            __UpperCamelCase      =       TFBertModelTester(self )
            __UpperCamelCase      =       clip_model_tester.prepare_config_and_inputs()
            __UpperCamelCase      =       bert_model_tester.prepare_config_and_inputs()

            __UpperCamelCase      =       vision_config_and_inputs

            (
                __UpperCamelCase							
            )      =       text_config_and_inputs

            return {
                "text_config": text_config,
                "vision_config": vision_config,
                "pixel_values": pixel_values,
                "attention_mask": input_mask,
                "input_ids": input_ids,
                "text_token_type_ids": token_type_ids,
                "text_sequence_labels": sequence_labels,
                "text_token_labels": token_labels,
                "text_choice_labels": choice_labels,
            }



@require_vision
@require_tf
class      __lowerCamelCase       (unittest.TestCase		):







       @slow
       def 						snake_case_     (       self:      List[Any] ):






            '''simple docstring'''




            __UpperCamelCase      =       TFVisionTextDualEncoderModel.from_pretrained(
                'clip-italian/clip-italian',logit_scale_init_value=1.0,from_pt=A_ )
            __UpperCamelCase      =       VisionTextDualEncoderProcessor.from_pretrained('clip-italian/clip-italian' )

            __UpperCamelCase      =       Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png' )
            __UpperCamelCase      =       processor(
                text=['una foto di un gatto', 'una foto di un cane'],images=A_,padding=A_,return_tensors='np' )

            __UpperCamelCase      =       model(**A_ )

            # verify the logits
            self.assertEqual(outputs.logits_per_image.shape,(inputs.pixel_values.shape[0], inputs.input_ids.shape[0]) )
            self.assertEqual(
                outputs.logits_per_text.shape,(inputs.input_ids.shape[0], inputs.pixel_values.shape[0]),)

            __UpperCamelCase      =       np.array([[1.2_2_8_4_7_2_7, 0.3_1_0_4_1_2_2]] )

            self.assertTrue(np.allclose(outputs.logits_per_image.numpy(),A_,atol=1E-3 ) )






'''simple docstring'''






import re
import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin






class    __snake_case       (   _SCREAMING_SNAKE_CASE):







    """simple docstring"""



    lowercase    =					['image_processor', 'tokenizer']
    lowercase    =					'AutoImageProcessor'
    lowercase    =					'AutoTokenizer'

    def __init__(   self    :  int    ,						lowerCamelCase    :  List[str]=None    ,						lowerCamelCase    :  Union[str, Any]=None    ,						**lowerCamelCase    :  str		)   ->  Tuple:
      lowerCAmelCase_			:      str			=   None
      if "feature_extractor" in kwargs:
        warnings.warn(
            """The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`"""
            """ instead."""    ,						lowerCamelCase    ,						)
        lowerCAmelCase_			:      Tuple			=   kwargs.pop("""feature_extractor"""		)

      lowerCAmelCase_			:      Tuple			=   image_processor if image_processor is not None else feature_extractor
      if image_processor is None:
        raise ValueError("""You need to specify an `image_processor`."""		)
      if tokenizer is None:
        raise ValueError("""You need to specify a `tokenizer`."""		)

      super().__init__(lowerCamelCase    ,						lowerCamelCase		)
      lowerCAmelCase_			:      Optional[int]			=   self.image_processor
      lowerCAmelCase_			:      Any			=   False

    def __call__(   self    :  List[Any]    ,						*lowerCamelCase    :  str    ,						**lowerCamelCase    :  Tuple		)   ->  Union[str, Any]:
      # For backward compatibility
      if self._in_target_context_manager:
        return self.current_processor(*lowerCamelCase    ,						**lowerCamelCase		)

      lowerCAmelCase_			:      Any			=   kwargs.pop("""images"""    ,						lowerCamelCase		)
      lowerCAmelCase_			:      Dict			=   kwargs.pop("""text"""    ,						lowerCamelCase		)
      if len(lowerCamelCase		) > 0:
        lowerCAmelCase_			:      str			=   args[0]
        lowerCAmelCase_			:      Dict			=   args[1:]

      if images is None and text is None:
        raise ValueError("""You need to specify either an `images` or `text` input to process."""		)

      if images is not None:
        lowerCAmelCase_			:      Any			=   self.image_processor(lowerCamelCase    ,						*lowerCamelCase    ,						**lowerCamelCase		)
      if text is not None:
        lowerCAmelCase_			:      str			=   self.tokenizer(lowerCamelCase    ,						**lowerCamelCase		)

      if text is None:
        return inputs
      elif images is None:
        return encodings
      else:
        lowerCAmelCase_			:      Dict			=   encodings["""input_ids"""]
        return inputs

    def __lowercase   (   self    :  str    ,						*lowerCamelCase    :  Union[str, Any]    ,						**lowerCamelCase    :  Union[str, Any]		)   ->  List[str]:
      return self.tokenizer.batch_decode(*lowerCamelCase    ,						**lowerCamelCase		)

    def __lowercase   (   self    :  List[Any]    ,						*lowerCamelCase    :  Any    ,						**lowerCamelCase    :  Union[str, Any]		)   ->  List[str]:
      return self.tokenizer.decode(*lowerCamelCase    ,						**lowerCamelCase		)

    @contextmanager
    def __lowercase   (   self    :  str		)   ->  Union[str, Any]:
      warnings.warn(
          """`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your """
          """labels by using the argument `text` of the regular `__call__` method (either in the same call as """
          """your images inputs, or in a separate call."""		)
      lowerCAmelCase_			:      List[str]			=   True
      lowerCAmelCase_			:      Optional[Any]			=   self.tokenizer
      yield
      lowerCAmelCase_			:      List[Any]			=   self.image_processor
      lowerCAmelCase_			:      List[str]			=   False

    def __lowercase   (   self    :  Dict    ,						lowerCamelCase    :  List[str]    ,						lowerCamelCase    :  str=False    ,						lowerCamelCase    :  List[Any]=None		)   ->  Optional[int]:
      if added_vocab is None:
        lowerCAmelCase_			:      str			=   self.tokenizer.get_added_vocab()

      lowerCAmelCase_			:      Union[str, Any]			=   {}

      while tokens:
        lowerCAmelCase_			:      Dict			=   re.search(R"""<s_(.*?)>"""    ,						lowerCamelCase    ,						re.IGNORECASE		)
        if start_token is None:
          break
        lowerCAmelCase_			:      Tuple			=   start_token.group(1		)
        lowerCAmelCase_			:      Tuple			=   re.search(RF'</s_{key}>'    ,						lowerCamelCase    ,						re.IGNORECASE		)
        lowerCAmelCase_			:      Tuple			=   start_token.group()
        if end_token is None:
          lowerCAmelCase_			:      str			=   tokens.replace(lowerCamelCase    ,						""""""		)
        else:
          lowerCAmelCase_			:      List[str]			=   end_token.group()
          lowerCAmelCase_			:      Dict			=   re.escape(lowerCamelCase		)
          lowerCAmelCase_			:      int			=   re.escape(lowerCamelCase		)
          lowerCAmelCase_			:      Dict			=   re.search(F'{start_token_escaped}(.*?){end_token_escaped}'    ,						lowerCamelCase    ,						re.IGNORECASE		)
          if content is not None:
            lowerCAmelCase_			:      str			=   content.group(1		).strip()
            if r"<s_" in content and r"</s_" in content:  # non-leaf node
              lowerCAmelCase_			:      str			=   self.tokenajson(lowerCamelCase    ,						is_inner_value=lowerCamelCase    ,						added_vocab=lowerCamelCase		)
              if value:
                if len(lowerCamelCase		) == 1:
                  lowerCAmelCase_			:      List[Any]			=   value[0]
                lowerCAmelCase_			:      Optional[Any]			=   value
            else:  # leaf nodes
              lowerCAmelCase_			:      List[str]			=   []
              for leaf in content.split(R"""<sep/>"""		):
                lowerCAmelCase_			:      Union[str, Any]			=   leaf.strip()
                if leaf in added_vocab and leaf[0] == "<" and leaf[-2:] == "/>":
                  lowerCAmelCase_			:      Any			=   leaf[1:-2]  # for categorical special tokens
                output[key].append(lowerCamelCase		)
              if len(output[key]		) == 1:
                lowerCAmelCase_			:      Optional[Any]			=   output[key][0]

          lowerCAmelCase_			:      List[Any]			=   tokens[tokens.find(lowerCamelCase		) + len(lowerCamelCase		) :].strip()
          if tokens[:6] == r"<sep/>":  # non-leaf nodes
            return [output] + self.tokenajson(tokens[6:]    ,						is_inner_value=lowerCamelCase    ,						added_vocab=lowerCamelCase		)

      if len(lowerCamelCase		):
        return [output] if is_inner_value else output
      else:
        return [] if is_inner_value else {"text_sequence": tokens}

    @property
    def __lowercase   (   self    :  Dict		)   ->  int:
      warnings.warn(
          """`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead."""    ,						lowerCamelCase    ,						)
      return self.image_processor_class





    @property
    def __lowercase   (   self    :  Dict		)   ->  Optional[Any]:
      warnings.warn(
          """`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead."""    ,						lowerCamelCase    ,						)
      return self.image_processor



