


'''simple docstring'''





import math
from collections import defaultdict
from typing import List, Optional, Tuple, Union

import numpy as np
import torch

from ..configuration_utils import ConfigMixin, register_to_config
from .scheduling_utils import KarrasDiffusionSchedulers, SchedulerMixin, SchedulerOutput


def        a__     (					UpperCamelCase_						:      Optional[int],   UpperCamelCase_						:      int=0.999,   UpperCamelCase_						:      Optional[int]="cosine",   ):
   if alpha_transform_type == "cosine":

      def alpha_bar_fn(UpperCamelCase_						:      Any						):
         return math.cos((t + 0.008) / 1.008 * math.pi / 2						) ** 2

   elif alpha_transform_type == "exp":

      def alpha_bar_fn(UpperCamelCase_						:      Dict						):
         return math.exp(t * -12.0						)

   else:
      raise ValueError(F'''Unsupported alpha_tranform_type: {alpha_transform_type}'''						)

   UpperCAmelCase__	:Any      =      []
   for i in range(UpperCamelCase_						):
      UpperCAmelCase__	:Dict      =      i / num_diffusion_timesteps
      UpperCAmelCase__	:Any      =      (i + 1) / num_diffusion_timesteps
      betas.append(min(1 - alpha_bar_fn(UpperCamelCase_						) / alpha_bar_fn(UpperCamelCase_						),   UpperCamelCase_						)						)
   return torch.tensor(UpperCamelCase_,   dtype=torch.floataa						)




class 				UpperCAmelCase			(			_snake_case						, _snake_case						):
 UpperCAmelCase				=					[e.name for e in KarrasDiffusionSchedulers]
 UpperCAmelCase				=					2


 @register_to_config
 def __init__(      self							:	List[Any]			,       __lowerCamelCase							:	int = 1_0_0_0			,       __lowerCamelCase							:	float = 0.0_00_85			,       __lowerCamelCase							:	float = 0.0_12			,       __lowerCamelCase							:	str = "linear"			,       __lowerCamelCase							:	Optional[Union[np.ndarray, List[float]]] = None			,       __lowerCamelCase							:	str = "epsilon"			,       __lowerCamelCase							:	Optional[bool] = False			,       __lowerCamelCase							:	Optional[bool] = False			,       __lowerCamelCase							:	float = 1.0			,       __lowerCamelCase							:	str = "linspace"			,       __lowerCamelCase							:	int = 0			,       ):
    if trained_betas is not None:
       UpperCAmelCase__	:int      =      torch.tensor(__lowerCamelCase			,       dtype=torch.floataa )
    elif beta_schedule == "linear":
       UpperCAmelCase__	:int      =      torch.linspace(__lowerCamelCase			,       __lowerCamelCase			,       __lowerCamelCase			,       dtype=torch.floataa )
    elif beta_schedule == "scaled_linear":
       # this schedule is very specific to the latent diffusion model.
       UpperCAmelCase__	:List[str]      =      (
           torch.linspace(beta_start**0.5			,       beta_end**0.5			,       __lowerCamelCase			,       dtype=torch.floataa ) ** 2
       )
    elif beta_schedule == "squaredcos_cap_v2":
       # Glide cosine schedule
       UpperCAmelCase__	:Tuple      =      betas_for_alpha_bar(__lowerCamelCase			,       alpha_transform_type='''cosine''' )
    elif beta_schedule == "exp":
       UpperCAmelCase__	:Any      =      betas_for_alpha_bar(__lowerCamelCase			,       alpha_transform_type='''exp''' )
    else:
       raise NotImplementedError(f'''{beta_schedule} does is not implemented for {self.__class__}''' )

    UpperCAmelCase__	:Dict      =      1.0 - self.betas
    UpperCAmelCase__	:Union[str, Any]      =      torch.cumprod(self.alphas			,       dim=0 )

    #  set all values
    self.set_timesteps(__lowerCamelCase			,       __lowerCamelCase			,       __lowerCamelCase )
    UpperCAmelCase__	:Tuple      =      use_karras_sigmas


 def        __SCREAMING_SNAKE_CASE					(      self							:	Union[str, Any]			,       __lowerCamelCase							:	Tuple			,       __lowerCamelCase							:	Union[str, Any]=None ):
    if schedule_timesteps is None:
       UpperCAmelCase__	:int      =      self.timesteps

    UpperCAmelCase__	:List[Any]      =      (schedule_timesteps == timestep).nonzero()

    # The sigma index that is taken for the **very** first `step`
    # is always the second index (or the last index if there is only 1)
    # This way we can ensure we don't accidentally skip a sigma in
    # case we start in the middle of the denoising schedule (e.g. for image-to-image)
    if len(self._index_counter ) == 0:
       UpperCAmelCase__	:Dict      =      1 if len(__lowerCamelCase ) > 1 else 0
    else:
       UpperCAmelCase__	:Dict      =      timestep.cpu().item() if torch.is_tensor(__lowerCamelCase ) else timestep
       UpperCAmelCase__	:int      =      self._index_counter[timestep_int]

    return indices[pos].item()


 @property
 def        __SCREAMING_SNAKE_CASE					(      self							:	Tuple ):
    # standard deviation of the initial noise distribution
    if self.config.timestep_spacing in ["linspace", "trailing"]:
       return self.sigmas.max()

    return (self.sigmas.max() ** 2 + 1) ** 0.5


 def        __SCREAMING_SNAKE_CASE					(      self							:	str			,       __lowerCamelCase							:	torch.FloatTensor			,       __lowerCamelCase							:	Union[float, torch.FloatTensor]			,       ):
    UpperCAmelCase__	:List[Any]      =      self.index_for_timestep(__lowerCamelCase )

    UpperCAmelCase__	:List[str]      =      self.sigmas[step_index]
    UpperCAmelCase__	:Dict      =      sample / ((sigma**2 + 1) ** 0.5)
    return sample


 def        __SCREAMING_SNAKE_CASE					(      self							:	Union[str, Any]			,       __lowerCamelCase							:	int			,       __lowerCamelCase							:	Union[str, torch.device] = None			,       __lowerCamelCase							:	Optional[int] = None			,       ):
    UpperCAmelCase__	:Optional[int]      =      num_inference_steps

    UpperCAmelCase__	:List[str]      =      num_train_timesteps or self.config.num_train_timesteps

    # "linspace", "leading", "trailing" corresponds to annotation of Table 2. of https://arxiv.org/abs/2305.08891
    if self.config.timestep_spacing == "linspace":
       UpperCAmelCase__	:List[str]      =      np.linspace(0			,       num_train_timesteps - 1			,       __lowerCamelCase			,       dtype=__lowerCamelCase )[::-1].copy()
    elif self.config.timestep_spacing == "leading":
       UpperCAmelCase__	:Dict      =      num_train_timesteps // self.num_inference_steps
       # creates integer timesteps by multiplying by ratio
       # casting to int to avoid issues when num_inference_step is power of 3
       UpperCAmelCase__	:int      =      (np.arange(0			,       __lowerCamelCase ) * step_ratio).round()[::-1].copy().astype(__lowerCamelCase )
       timesteps += self.config.steps_offset
    elif self.config.timestep_spacing == "trailing":
       UpperCAmelCase__	:Optional[Any]      =      num_train_timesteps / self.num_inference_steps
       # creates integer timesteps by multiplying by ratio
       # casting to int to avoid issues when num_inference_step is power of 3
       UpperCAmelCase__	:Union[str, Any]      =      (np.arange(__lowerCamelCase			,       0			,       -step_ratio )).round().copy().astype(__lowerCamelCase )
       timesteps -= 1
    else:
       raise ValueError(
           f'''{self.config.timestep_spacing} is not supported. Please make sure to choose one of \'linspace\', \'leading\' or \'trailing\'.''' )

    UpperCAmelCase__	:int      =      np.array(((1 - self.alphas_cumprod) / self.alphas_cumprod) ** 0.5 )
    UpperCAmelCase__	:Union[str, Any]      =      np.log(__lowerCamelCase )
    UpperCAmelCase__	:Optional[int]      =      np.interp(__lowerCamelCase			,       np.arange(0			,       len(__lowerCamelCase ) )			,       __lowerCamelCase )

    if self.config.use_karras_sigmas:
       UpperCAmelCase__	:int      =      self._convert_to_karras(in_sigmas=__lowerCamelCase			,       num_inference_steps=self.num_inference_steps )
       UpperCAmelCase__	:str      =      np.array([self._sigma_to_t(__lowerCamelCase			,       __lowerCamelCase ) for sigma in sigmas] )

    UpperCAmelCase__	:List[str]      =      np.concatenate([sigmas, [0.0]] ).astype(np.floataa )
    UpperCAmelCase__	:Dict      =      torch.from_numpy(__lowerCamelCase ).to(device=__lowerCamelCase )
    UpperCAmelCase__	:Any      =      torch.cat([sigmas[:1], sigmas[1:-1].repeat_interleave(2 ), sigmas[-1:]] )

    UpperCAmelCase__	:Tuple      =      torch.from_numpy(__lowerCamelCase )
    UpperCAmelCase__	:Optional[int]      =      torch.cat([timesteps[:1], timesteps[1:].repeat_interleave(2 )] )

    if str(__lowerCamelCase ).startswith('''mps''' ):
       # mps does not support float64
       UpperCAmelCase__	:List[Any]      =      timesteps.to(__lowerCamelCase			,       dtype=torch.floataa )
    else:
       UpperCAmelCase__	:str      =      timesteps.to(device=__lowerCamelCase )

    # empty dt and derivative
    UpperCAmelCase__	:Tuple      =      None
    UpperCAmelCase__	:Any      =      None

    # for exp beta schedules, such as the one for `pipeline_shap_e.py`
    # we need an index counter
    UpperCAmelCase__	:Optional[int]      =      defaultdict(__lowerCamelCase )


 def        __SCREAMING_SNAKE_CASE					(      self							:	int			,       __lowerCamelCase							:	Union[str, Any]			,       __lowerCamelCase							:	List[str] ):
    # get log sigma
    UpperCAmelCase__	:Any      =      np.log(__lowerCamelCase )

    # get distribution
    UpperCAmelCase__	:int      =      log_sigma - log_sigmas[:, np.newaxis]

    # get sigmas range
    UpperCAmelCase__	:str      =      np.cumsum((dists >= 0)			,       axis=0 ).argmax(axis=0 ).clip(max=log_sigmas.shape[0] - 2 )
    UpperCAmelCase__	:Optional[Any]      =      low_idx + 1

    UpperCAmelCase__	:Optional[Any]      =      log_sigmas[low_idx]
    UpperCAmelCase__	:Any      =      log_sigmas[high_idx]

    # interpolate sigmas
    UpperCAmelCase__	:int      =      (low - log_sigma) / (low - high)
    UpperCAmelCase__	:Union[str, Any]      =      np.clip(__lowerCamelCase			,       0			,       1 )

    # transform interpolation to time range
    UpperCAmelCase__	:List[Any]      =      (1 - w) * low_idx + w * high_idx
    UpperCAmelCase__	:int      =      t.reshape(sigma.shape )
    return t


 def        __SCREAMING_SNAKE_CASE					(      self							:	Optional[int]			,       __lowerCamelCase							:	torch.FloatTensor			,       __lowerCamelCase							:	Optional[Any] ):
    UpperCAmelCase__	:float      =      in_sigmas[-1].item()
    UpperCAmelCase__	:float      =      in_sigmas[0].item()

    UpperCAmelCase__	:int      =      7.0  # 7.0 is the value used in the paper
    UpperCAmelCase__	:Optional[Any]      =      np.linspace(0			,       1			,       __lowerCamelCase )
    UpperCAmelCase__	:int      =      sigma_min ** (1 / rho)
    UpperCAmelCase__	:Any      =      sigma_max ** (1 / rho)
    UpperCAmelCase__	:Tuple      =      (max_inv_rho + ramp * (min_inv_rho - max_inv_rho)) ** rho
    return sigmas


 @property
 def        __SCREAMING_SNAKE_CASE					(      self							:	int ):
    return self.dt is None


 def        __SCREAMING_SNAKE_CASE					(      self							:	List[Any]			,       __lowerCamelCase							:	Union[torch.FloatTensor, np.ndarray]			,       __lowerCamelCase							:	Union[float, torch.FloatTensor]			,       __lowerCamelCase							:	Union[torch.FloatTensor, np.ndarray]			,       __lowerCamelCase							:	bool = True			,       ):
    UpperCAmelCase__	:Optional[Any]      =      self.index_for_timestep(__lowerCamelCase )

    # advance index counter by 1
    UpperCAmelCase__	:Union[str, Any]      =      timestep.cpu().item() if torch.is_tensor(__lowerCamelCase ) else timestep
    self._index_counter[timestep_int] += 1

    if self.state_in_first_order:
       UpperCAmelCase__	:Tuple      =      self.sigmas[step_index]
       UpperCAmelCase__	:Any      =      self.sigmas[step_index + 1]
    else:
       # 2nd order / Heun's method
       UpperCAmelCase__	:Dict      =      self.sigmas[step_index - 1]
       UpperCAmelCase__	:Dict      =      self.sigmas[step_index]

    # currently only gamma=0 is supported. This usually works best anyways.
    # We can support gamma in the future but then need to scale the timestep before
    # passing it to the model which requires a change in API
    UpperCAmelCase__	:List[str]      =      0
    UpperCAmelCase__	:Optional[Any]      =      sigma * (gamma + 1)  # Note: sigma_hat == sigma for now

    # 1. compute predicted original sample (x_0) from sigma-scaled predicted noise
    if self.config.prediction_type == "epsilon":
       UpperCAmelCase__	:int      =      sigma_hat if self.state_in_first_order else sigma_next
       UpperCAmelCase__	:Optional[Any]      =      sample - sigma_input * model_output
    elif self.config.prediction_type == "v_prediction":
       UpperCAmelCase__	:Union[str, Any]      =      sigma_hat if self.state_in_first_order else sigma_next
       UpperCAmelCase__	:Optional[int]      =      model_output * (-sigma_input / (sigma_input**2 + 1) ** 0.5) + (
           sample / (sigma_input**2 + 1)
       )
    elif self.config.prediction_type == "sample":
       UpperCAmelCase__	:Tuple      =      model_output
    else:
       raise ValueError(
           f'''prediction_type given as {self.config.prediction_type} must be one of `epsilon`, or `v_prediction`''' )

    if self.config.clip_sample:
       UpperCAmelCase__	:List[str]      =      pred_original_sample.clamp(
           -self.config.clip_sample_range			,       self.config.clip_sample_range )

    if self.state_in_first_order:
       # 2. Convert to an ODE derivative for 1st order
       UpperCAmelCase__	:List[str]      =      (sample - pred_original_sample) / sigma_hat
       # 3. delta timestep
       UpperCAmelCase__	:Optional[int]      =      sigma_next - sigma_hat

       # store for 2nd order step
       UpperCAmelCase__	:List[Any]      =      derivative
       UpperCAmelCase__	:Dict      =      dt
       UpperCAmelCase__	:List[Any]      =      sample
    else:
       # 2. 2nd order / Heun's method
       UpperCAmelCase__	:int      =      (sample - pred_original_sample) / sigma_next
       UpperCAmelCase__	:Dict      =      (self.prev_derivative + derivative) / 2

       # 3. take prev timestep & sample
       UpperCAmelCase__	:Optional[Any]      =      self.dt
       UpperCAmelCase__	:List[str]      =      self.sample

       # free dt and derivative
       # Note, this puts the scheduler in "first order mode"
       UpperCAmelCase__	:Optional[Any]      =      None
       UpperCAmelCase__	:Any      =      None
       UpperCAmelCase__	:Dict      =      None

    UpperCAmelCase__	:int      =      sample + derivative * dt

    if not return_dict:
       return (prev_sample,)

    return SchedulerOutput(prev_sample=__lowerCamelCase )


 def        __SCREAMING_SNAKE_CASE					(      self							:	str			,       __lowerCamelCase							:	torch.FloatTensor			,       __lowerCamelCase							:	torch.FloatTensor			,       __lowerCamelCase							:	torch.FloatTensor			,       ):
    # Make sure sigmas and timesteps have the same device and dtype as original_samples
    UpperCAmelCase__	:Any      =      self.sigmas.to(device=original_samples.device			,       dtype=original_samples.dtype )
    if original_samples.device.type == "mps" and torch.is_floating_point(__lowerCamelCase ):
       # mps does not support float64
       UpperCAmelCase__	:Any      =      self.timesteps.to(original_samples.device			,       dtype=torch.floataa )
       UpperCAmelCase__	:int      =      timesteps.to(original_samples.device			,       dtype=torch.floataa )
    else:
       UpperCAmelCase__	:List[Any]      =      self.timesteps.to(original_samples.device )
       UpperCAmelCase__	:int      =      timesteps.to(original_samples.device )

    UpperCAmelCase__	:Any      =      [self.index_for_timestep(__lowerCamelCase			,       __lowerCamelCase ) for t in timesteps]

    UpperCAmelCase__	:Union[str, Any]      =      sigmas[step_indices].flatten()
    while len(sigma.shape ) < len(original_samples.shape ):
       UpperCAmelCase__	:str      =      sigma.unsqueeze(-1 )

    UpperCAmelCase__	:Dict      =      original_samples + noise * sigma
    return noisy_samples





 def __len__(      self							:	Tuple ):
    return self.config.num_train_timesteps







'''simple docstring'''





import warnings
from typing import List

import numpy as np

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding
from ...utils import is_flax_available, is_tf_available, is_torch_available




class 				UpperCAmelCase			(			_snake_case						):
 UpperCAmelCase				=					["image_processor", "tokenizer"]
 UpperCAmelCase				=					"OwlViTImageProcessor"
 UpperCAmelCase				=					("CLIPTokenizer", "CLIPTokenizerFast")


 def __init__(      self							:	List[str]			,       __lowerCamelCase							:	Optional[int]=None			,       __lowerCamelCase							:	Optional[Any]=None			,       **__lowerCamelCase							:	str ):
    UpperCAmelCase__	:int      =      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			,       )
       UpperCAmelCase__	:Union[str, Any]      =      kwargs.pop('''feature_extractor''' )

    UpperCAmelCase__	:List[str]      =      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 )


 def __call__(      self							:	int			,       __lowerCamelCase							:	str=None			,       __lowerCamelCase							:	List[Any]=None			,       __lowerCamelCase							:	Dict=None			,       __lowerCamelCase							:	str="max_length"			,       __lowerCamelCase							:	Any="np"			,       **__lowerCamelCase							:	Tuple ):

    if text is None and query_images is None and images is None:
       raise ValueError(
           '''You have to specify at least one text or query image or image. All three cannot be none.''' )

    if text is not None:
       if isinstance(__lowerCamelCase			,       __lowerCamelCase ) or (isinstance(__lowerCamelCase			,       __lowerCamelCase ) and not isinstance(text[0]			,       __lowerCamelCase )):
          UpperCAmelCase__	:Any      =      [self.tokenizer(__lowerCamelCase			,       padding=__lowerCamelCase			,       return_tensors=__lowerCamelCase			,       **__lowerCamelCase )]

       elif isinstance(__lowerCamelCase			,       __lowerCamelCase ) and isinstance(text[0]			,       __lowerCamelCase ):
          UpperCAmelCase__	:Tuple      =      []

          # Maximum number of queries across batch
          UpperCAmelCase__	:List[str]      =      max([len(__lowerCamelCase ) for t in text] )

          # Pad all batch samples to max number of text queries
          for t in text:
             if len(__lowerCamelCase ) != max_num_queries:
                UpperCAmelCase__	:str      =      t + [''' '''] * (max_num_queries - len(__lowerCamelCase ))

             UpperCAmelCase__	:Tuple      =      self.tokenizer(__lowerCamelCase			,       padding=__lowerCamelCase			,       return_tensors=__lowerCamelCase			,       **__lowerCamelCase )
             encodings.append(__lowerCamelCase )
       else:
          raise TypeError('''Input text should be a string, a list of strings or a nested list of strings''' )

       if return_tensors == "np":
          UpperCAmelCase__	:List[Any]      =      np.concatenate([encoding['''input_ids'''] for encoding in encodings]			,       axis=0 )
          UpperCAmelCase__	:Any      =      np.concatenate([encoding['''attention_mask'''] for encoding in encodings]			,       axis=0 )

       elif return_tensors == "jax" and is_flax_available():
          import jax.numpy as jnp

          UpperCAmelCase__	:List[Any]      =      jnp.concatenate([encoding['''input_ids'''] for encoding in encodings]			,       axis=0 )
          UpperCAmelCase__	:Union[str, Any]      =      jnp.concatenate([encoding['''attention_mask'''] for encoding in encodings]			,       axis=0 )

       elif return_tensors == "pt" and is_torch_available():
          import torch

          UpperCAmelCase__	:Any      =      torch.cat([encoding['''input_ids'''] for encoding in encodings]			,       dim=0 )
          UpperCAmelCase__	:List[str]      =      torch.cat([encoding['''attention_mask'''] for encoding in encodings]			,       dim=0 )

       elif return_tensors == "tf" and is_tf_available():
          import tensorflow as tf

          UpperCAmelCase__	:Optional[Any]      =      tf.stack([encoding['''input_ids'''] for encoding in encodings]			,       axis=0 )
          UpperCAmelCase__	:int      =      tf.stack([encoding['''attention_mask'''] for encoding in encodings]			,       axis=0 )

       else:
          raise ValueError('''Target return tensor type could not be returned''' )

       UpperCAmelCase__	:List[Any]      =      BatchEncoding()
       UpperCAmelCase__	:Union[str, Any]      =      input_ids
       UpperCAmelCase__	:Dict      =      attention_mask

    if query_images is not None:
       UpperCAmelCase__	:Tuple      =      BatchEncoding()
       UpperCAmelCase__	:int      =      self.image_processor(
           __lowerCamelCase			,       return_tensors=__lowerCamelCase			,       **__lowerCamelCase ).pixel_values
       UpperCAmelCase__	:Optional[int]      =      query_pixel_values

    if images is not None:
       UpperCAmelCase__	:str      =      self.image_processor(__lowerCamelCase			,       return_tensors=__lowerCamelCase			,       **__lowerCamelCase )

    if text is not None and images is not None:
       UpperCAmelCase__	:Dict      =      image_features.pixel_values
       return encoding
    elif query_images is not None and images is not None:
       UpperCAmelCase__	:Tuple      =      image_features.pixel_values
       return encoding
    elif text is not None or query_images is not None:
       return encoding
    else:
       return BatchEncoding(data=dict(**__lowerCamelCase )			,       tensor_type=__lowerCamelCase )


 def        __SCREAMING_SNAKE_CASE					(      self							:	int			,       *__lowerCamelCase							:	Optional[int]			,       **__lowerCamelCase							:	int ):
    return self.image_processor.post_process(*__lowerCamelCase			,       **__lowerCamelCase )


 def        __SCREAMING_SNAKE_CASE					(      self							:	Dict			,       *__lowerCamelCase							:	Any			,       **__lowerCamelCase							:	Tuple ):
    return self.image_processor.post_process_object_detection(*__lowerCamelCase			,       **__lowerCamelCase )


 def        __SCREAMING_SNAKE_CASE					(      self							:	Union[str, Any]			,       *__lowerCamelCase							:	Tuple			,       **__lowerCamelCase							:	str ):
    return self.image_processor.post_process_image_guided_detection(*__lowerCamelCase			,       **__lowerCamelCase )


 def        __SCREAMING_SNAKE_CASE					(      self							:	int			,       *__lowerCamelCase							:	Optional[Any]			,       **__lowerCamelCase							:	Union[str, Any] ):
    return self.tokenizer.batch_decode(*__lowerCamelCase			,       **__lowerCamelCase )


 def        __SCREAMING_SNAKE_CASE					(      self							:	Optional[Any]			,       *__lowerCamelCase							:	Union[str, Any]			,       **__lowerCamelCase							:	Dict ):
    return self.tokenizer.decode(*__lowerCamelCase			,       **__lowerCamelCase )


 @property
 def        __SCREAMING_SNAKE_CASE					(      self							:	Union[str, Any] ):
    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        __SCREAMING_SNAKE_CASE					(      self							:	Union[str, Any] ):
    warnings.warn(
        '''`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.'''			,       __lowerCamelCase			,       )
    return self.image_processor



