




'''simple docstring'''







import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING


lowercase      :   Optional[Any]      =       logging.get_logger(__name__)

lowercase      :   Optional[int]      =       {
    '''ut/deta''': '''https://huggingface.co/ut/deta/resolve/main/config.json''',
}







class 					_a (a__	):





     '''simple docstring'''



     lowerCAmelCase_  :     int          =					"""deta"""
     lowerCAmelCase_  :     int          =					{
         """hidden_size""": """d_model""",
         """num_attention_heads""": """encoder_attention_heads""",
     }







     def __init__(				self							,__a=None							,__a=900							,__a=2_048							,__a=6							,__a=2_048							,__a=8							,__a=6							,__a=1_024							,__a=8							,__a=0.0							,__a=True							,__a="relu"							,__a=256							,__a=0.1							,__a=0.0							,__a=0.0							,__a=0.02							,__a=1.0							,__a=True							,__a=False							,__a="sine"							,__a=5							,__a=4							,__a=4							,__a=True							,__a=300							,__a=True							,__a=True							,__a=1							,__a=5							,__a=2							,__a=1							,__a=1							,__a=5							,__a=2							,__a=0.1							,__a=0.25							,**__a							,)      ->				Dict:
          if backbone_config is None:
               logger.info("""`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone."""							)
               snake_case			:      Optional[int]        =			CONFIG_MAPPING["""resnet"""](out_features=["""stage2""", """stage3""", """stage4"""]							)
          else:
               if isinstance(__a							,__a							):
                    snake_case			:      Optional[int]        =			backbone_config.pop("""model_type"""							)
                    snake_case			:      Tuple        =			CONFIG_MAPPING[backbone_model_type]
                    snake_case			:      Dict        =			config_class.from_dict(__a							)

          snake_case			:      Optional[int]        =			backbone_config
          snake_case			:      Dict        =			num_queries
          snake_case			:      Tuple        =			max_position_embeddings
          snake_case			:      Union[str, Any]        =			d_model
          snake_case			:      List[str]        =			encoder_ffn_dim
          snake_case			:      Optional[int]        =			encoder_layers
          snake_case			:      List[Any]        =			encoder_attention_heads
          snake_case			:      int        =			decoder_ffn_dim
          snake_case			:      Optional[Any]        =			decoder_layers
          snake_case			:      int        =			decoder_attention_heads
          snake_case			:      Union[str, Any]        =			dropout
          snake_case			:      Optional[int]        =			attention_dropout
          snake_case			:      List[Any]        =			activation_dropout
          snake_case			:      Dict        =			activation_function
          snake_case			:      Union[str, Any]        =			init_std
          snake_case			:      int        =			init_xavier_std
          snake_case			:      int        =			encoder_layerdrop
          snake_case			:      List[str]        =			auxiliary_loss
          snake_case			:      Any        =			position_embedding_type
          # deformable attributes
          snake_case			:      List[Any]        =			num_feature_levels
          snake_case			:      List[str]        =			encoder_n_points
          snake_case			:      List[Any]        =			decoder_n_points
          snake_case			:      List[str]        =			two_stage
          snake_case			:      Tuple        =			two_stage_num_proposals
          snake_case			:      Optional[int]        =			with_box_refine
          snake_case			:      Dict        =			assign_first_stage
          if two_stage is True and with_box_refine is False:
               raise ValueError("""If two_stage is True, with_box_refine must be True."""							)
          # Hungarian matcher
          snake_case			:      Tuple        =			class_cost
          snake_case			:      Tuple        =			bbox_cost
          snake_case			:      List[str]        =			giou_cost
          # Loss coefficients
          snake_case			:      Dict        =			mask_loss_coefficient
          snake_case			:      Dict        =			dice_loss_coefficient
          snake_case			:      Dict        =			bbox_loss_coefficient
          snake_case			:      List[str]        =			giou_loss_coefficient
          snake_case			:      Any        =			eos_coefficient
          snake_case			:      str        =			focal_alpha
          super().__init__(is_encoder_decoder=__a							,**__a							)







     @property
     def 			snake_case_      (				self							)      ->				int:
          return self.encoder_attention_heads







     @property
     def 			snake_case_      (				self							)      ->				int:
          return self.d_model







     def 			snake_case_      (				self							)      ->				Tuple:
          snake_case			:      Optional[int]        =			copy.deepcopy(self.__dict__							)
          snake_case			:      Optional[int]        =			self.backbone_config.to_dict()
          snake_case			:      Any        =			self.__class__.model_type
          return output











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


__a:     Dict   					=					logging.get_logger(__name__)

__a:     Optional[int]   					=					{
    '''google/efficientnet-b7''': '''https://huggingface.co/google/efficientnet-b7/resolve/main/config.json''',
}
class 		SCREAMING_SNAKE_CASE__	(  UpperCAmelCase     ):

  '''simple docstring'''







  _lowerCamelCase    =  '''efficientnet'''


  def __init__(      self		:			Dict       ,				lowerCamelCase		:			int = 3       ,				lowerCamelCase		:			int = 600       ,				lowerCamelCase		:			float = 2.0       ,				lowerCamelCase		:			float = 3.1       ,				lowerCamelCase		:			int = 8       ,				lowerCamelCase		:			List[int] = [3, 3, 5, 3, 5, 5, 3]       ,				lowerCamelCase		:			List[int] = [32, 16, 24, 40, 80, 112, 192]       ,				lowerCamelCase		:			List[int] = [16, 24, 40, 80, 112, 192, 320]       ,				lowerCamelCase		:			List[int] = []       ,				lowerCamelCase		:			List[int] = [1, 2, 2, 2, 1, 2, 1]       ,				lowerCamelCase		:			List[int] = [1, 2, 2, 3, 3, 4, 1]       ,				lowerCamelCase		:			List[int] = [1, 6, 6, 6, 6, 6, 6]       ,				lowerCamelCase		:			float = 0.25       ,				lowerCamelCase		:			str = "swish"       ,				lowerCamelCase		:			int = 2560       ,				lowerCamelCase		:			str = "mean"       ,				lowerCamelCase		:			float = 0.02       ,				lowerCamelCase		:			float = 0.001       ,				lowerCamelCase		:			float = 0.99       ,				lowerCamelCase		:			float = 0.5       ,				lowerCamelCase		:			float = 0.2       ,				**lowerCamelCase		:			List[str]       ,				)						->	Union[str, Any]:


         """simple docstring"""
         super().__init__(**lowerCamelCase							)

         _UpperCAmelCase							=    num_channels
         _UpperCAmelCase							=    image_size
         _UpperCAmelCase							=    width_coefficient
         _UpperCAmelCase							=    depth_coefficient
         _UpperCAmelCase							=    depth_divisor
         _UpperCAmelCase							=    kernel_sizes
         _UpperCAmelCase							=    in_channels
         _UpperCAmelCase							=    out_channels
         _UpperCAmelCase							=    depthwise_padding
         _UpperCAmelCase							=    strides
         _UpperCAmelCase							=    num_block_repeats
         _UpperCAmelCase							=    expand_ratios
         _UpperCAmelCase							=    squeeze_expansion_ratio
         _UpperCAmelCase							=    hidden_act
         _UpperCAmelCase							=    hidden_dim
         _UpperCAmelCase							=    pooling_type
         _UpperCAmelCase							=    initializer_range
         _UpperCAmelCase							=    batch_norm_eps
         _UpperCAmelCase							=    batch_norm_momentum
         _UpperCAmelCase							=    dropout_rate
         _UpperCAmelCase							=    drop_connect_rate
         _UpperCAmelCase							=    sum(lowerCamelCase							) * 4



class 		SCREAMING_SNAKE_CASE__	(  UpperCAmelCase     ):

  '''simple docstring'''







  _lowerCamelCase    =  version.parse('''1.11'''     )


  @property
  def  lowerCamelCase       (      self		:			Optional[Any]							)						->	Mapping[str, Mapping[int, str]]:


         """simple docstring"""
         return OrderedDict(
             [
                 ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
             ]							)





  @property
  def  lowerCamelCase       (      self		:			Dict							)						->	float:


         """simple docstring"""
         return 1E-5