


import warnings

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding





class    _a				(							_lowercase):
	_a    :    Optional[int]        =				['''image_processor''', '''tokenizer''']
	_a    :    List[str]        =				'''VideoMAEImageProcessor'''
	_a    :    Dict        =				('''CLIPTokenizer''', '''CLIPTokenizerFast''')




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

			lowerCAmelCase__  :     Any       	=   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__(_SCREAMING_SNAKE_CASE						,   _SCREAMING_SNAKE_CASE						)
			lowerCAmelCase__  :     List[Any]       	=   self.image_processor




	def __call__(   self		:						str						,   _SCREAMING_SNAKE_CASE		:						Union[str, Any]=None						,   _SCREAMING_SNAKE_CASE		:						str=None						,   _SCREAMING_SNAKE_CASE		:						Optional[Any]=None						,   **_SCREAMING_SNAKE_CASE		:						int						)->			str:

			if text is None and videos is None:
					raise ValueError('''You have to specify either text or videos. Both cannot be none.'''						)

			if text is not None:
					lowerCAmelCase__  :     Optional[Any]       	=   self.tokenizer(_SCREAMING_SNAKE_CASE						,   return_tensors=_SCREAMING_SNAKE_CASE						,   **_SCREAMING_SNAKE_CASE						)

			if videos is not None:
					lowerCAmelCase__  :     Optional[Any]       	=   self.image_processor(_SCREAMING_SNAKE_CASE						,   return_tensors=_SCREAMING_SNAKE_CASE						,   **_SCREAMING_SNAKE_CASE						)

			if text is not None and videos is not None:
					lowerCAmelCase__  :     int       	=   image_features.pixel_values
					return encoding
			elif text is not None:
					return encoding
			else:
					return BatchEncoding(data=dict(**_SCREAMING_SNAKE_CASE						)						,   tensor_type=_SCREAMING_SNAKE_CASE						)




	def 				UpperCAmelCase__(   self		:						str						,   *_SCREAMING_SNAKE_CASE		:						Union[str, Any]						,   **_SCREAMING_SNAKE_CASE		:						Optional[Any]						)->			Optional[Any]:
			return self.tokenizer.batch_decode(*_SCREAMING_SNAKE_CASE						,   **_SCREAMING_SNAKE_CASE						)




	def 				UpperCAmelCase__(   self		:						List[str]						,   *_SCREAMING_SNAKE_CASE		:						List[Any]						,   **_SCREAMING_SNAKE_CASE		:						List[Any]						)->			Optional[int]:
			return self.tokenizer.decode(*_SCREAMING_SNAKE_CASE						,   **_SCREAMING_SNAKE_CASE						)




	@property
	def 				UpperCAmelCase__(   self		:						int						)->			Dict:
			return ["input_ids", "attention_mask", "position_ids", "pixel_values"]




	@property
	def 				UpperCAmelCase__(   self		:						Dict						)->			Tuple:
			warnings.warn(
			    '''`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'''						,   _SCREAMING_SNAKE_CASE						,   )
			return self.image_processor_class




	@property
	def 				UpperCAmelCase__(   self		:						str						)->			int:
			warnings.warn(
			    '''`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.'''						,   _SCREAMING_SNAKE_CASE						,   )
			return self.image_processor








import warnings

from ...utils import logging
from .image_processing_maskformer import MaskFormerImageProcessor


lowerCamelCase		=						logging.get_logger(__name__)





class    _a				(							_lowercase):




	def __init__(   self		:						Any						,   *_SCREAMING_SNAKE_CASE		:						int						,   **_SCREAMING_SNAKE_CASE		:						Dict						)->			None:
			warnings.warn(
			    '''The class MaskFormerFeatureExtractor is deprecated and will be removed in version 5 of Transformers.'''
			    ''' Please use MaskFormerImageProcessor instead.'''						,   _SCREAMING_SNAKE_CASE						,   )
			super().__init__(*_SCREAMING_SNAKE_CASE						,   **_SCREAMING_SNAKE_CASE						)




