


import warnings
from typing import List, Optional, Union

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
from ...utils import TensorType







class 						_snake_case  (				_a							):
 SCREAMING_SNAKE_CASE__				=	['image_processor', 'tokenizer']
 SCREAMING_SNAKE_CASE__				=	'ViltImageProcessor'
 SCREAMING_SNAKE_CASE__				=	('BertTokenizer', 'BertTokenizerFast')




 def __init__(		self ,  _lowerCamelCase=None ,  _lowerCamelCase=None ,  **_lowerCamelCase   ):
       a						: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.''' ,  snake_case_ ,  )
             a						:List[Any]										=	kwargs.pop('''feature_extractor'''   )

       a						:Union[str, 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__(snake_case_ ,  snake_case_   )
       a						:Tuple										=	self.image_processor




 def __call__(		self ,  _lowerCamelCase ,  _lowerCamelCase = None ,  _lowerCamelCase = True ,  _lowerCamelCase = False ,  _lowerCamelCase = None ,  _lowerCamelCase = None ,  _lowerCamelCase = 0 ,  _lowerCamelCase = None ,  _lowerCamelCase = None ,  _lowerCamelCase = None ,  _lowerCamelCase = False ,  _lowerCamelCase = False ,  _lowerCamelCase = False ,  _lowerCamelCase = False ,  _lowerCamelCase = True ,  _lowerCamelCase = None ,  **_lowerCamelCase ,  ):
       a						:List[Any]										=	self.tokenizer(
           text=snake_case_ ,  add_special_tokens=snake_case_ ,  padding=snake_case_ ,  truncation=snake_case_ ,  max_length=snake_case_ ,  stride=snake_case_ ,  pad_to_multiple_of=snake_case_ ,  return_token_type_ids=snake_case_ ,  return_attention_mask=snake_case_ ,  return_overflowing_tokens=snake_case_ ,  return_special_tokens_mask=snake_case_ ,  return_offsets_mapping=snake_case_ ,  return_length=snake_case_ ,  verbose=snake_case_ ,  return_tensors=snake_case_ ,  **snake_case_ ,  )
       # add pixel_values + pixel_mask
       a						:List[str]										=	self.image_processor(snake_case_ ,  return_tensors=snake_case_   )
       encoding.update(snake_case_   )

       return encoding




 def 	SCREAMING_SNAKE_CASE__    (		self ,  *_lowerCamelCase ,  **_lowerCamelCase   ):
       return self.tokenizer.batch_decode(*snake_case_ ,  **snake_case_   )




 def 	SCREAMING_SNAKE_CASE__    (		self ,  *_lowerCamelCase ,  **_lowerCamelCase   ):
       return self.tokenizer.decode(*snake_case_ ,  **snake_case_   )




 @property
 def 	SCREAMING_SNAKE_CASE__    (		self   ):
       a						:str										=	self.tokenizer.model_input_names
       a						:str										=	self.image_processor.model_input_names
       return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names   )   )




 @property
 def 	SCREAMING_SNAKE_CASE__    (		self   ):
       warnings.warn(
           '''`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.''' ,  snake_case_ ,  )
       return self.image_processor_class




 @property
 def 	SCREAMING_SNAKE_CASE__    (		self   ):
       warnings.warn(
           '''`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.''' ,  snake_case_ ,  )
       return self.image_processor









from collections import OrderedDict
from typing import List, Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


snake_case    :   Union[str, Any]	    =					logging.get_logger(__name__)

snake_case    :   List[str]	    =					{
    '''google/efficientnet-b7''': '''https://huggingface.co/google/efficientnet-b7/resolve/main/config.json''',
}







class 		_snake_case  (				_snake_case							):
 SCREAMING_SNAKE_CASE__				=	'efficientnet'




 def __init__(		self ,  _lowerCamelCase = 3 ,  _lowerCamelCase = 600 ,  _lowerCamelCase = 2.0 ,  _lowerCamelCase = 3.1 ,  _lowerCamelCase = 8 ,  _lowerCamelCase = [3, 3, 5, 3, 5, 5, 3] ,  _lowerCamelCase = [32, 16, 24, 40, 80, 112, 192] ,  _lowerCamelCase = [16, 24, 40, 80, 112, 192, 320] ,  _lowerCamelCase = [] ,  _lowerCamelCase = [1, 2, 2, 2, 1, 2, 1] ,  _lowerCamelCase = [1, 2, 2, 3, 3, 4, 1] ,  _lowerCamelCase = [1, 6, 6, 6, 6, 6, 6] ,  _lowerCamelCase = 0.25 ,  _lowerCamelCase = "swish" ,  _lowerCamelCase = 2560 ,  _lowerCamelCase = "mean" ,  _lowerCamelCase = 0.02 ,  _lowerCamelCase = 0.001 ,  _lowerCamelCase = 0.99 ,  _lowerCamelCase = 0.5 ,  _lowerCamelCase = 0.2 ,  **_lowerCamelCase ,  ):
       super().__init__(**_lowerCamelCase   )

       a						:Optional[int]										=	num_channels
       a						:List[str]										=	image_size
       a						:int										=	width_coefficient
       a						:Optional[Any]										=	depth_coefficient
       a						:Any										=	depth_divisor
       a						:Any										=	kernel_sizes
       a						:Tuple										=	in_channels
       a						:Union[str, Any]										=	out_channels
       a						:Any										=	depthwise_padding
       a						:Any										=	strides
       a						:Optional[Any]										=	num_block_repeats
       a						:Tuple										=	expand_ratios
       a						:Dict										=	squeeze_expansion_ratio
       a						:int										=	hidden_act
       a						:Dict										=	hidden_dim
       a						:Tuple										=	pooling_type
       a						:Any										=	initializer_range
       a						:Tuple										=	batch_norm_eps
       a						:Optional[int]										=	batch_norm_momentum
       a						:List[Any]										=	dropout_rate
       a						:Optional[int]										=	drop_connect_rate
       a						:Tuple										=	sum(_lowerCamelCase   ) * 4







class 		_snake_case  (				_snake_case							):
 SCREAMING_SNAKE_CASE__				=	version.parse('1.11'							)




 @property
 def 	SCREAMING_SNAKE_CASE__    (		self   ):
       return OrderedDict(
           [
               ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
           ]   )




 @property
 def 	SCREAMING_SNAKE_CASE__    (		self   ):
       return 1e-5





