
"""simple docstring"""


import warnings
from collections import OrderedDict
from typing import Mapping

from packaging import version

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


_lowercase							   =				logging.get_logger(__name__)

_lowercase							   =				{
    '''nvidia/segformer-b0-finetuned-ade-512-512''': (
        '''https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512/resolve/main/config.json'''
    ),
    # See all SegFormer models at https://huggingface.co/models?filter=segformer
}







class 				lowerCAmelCase_				(      _lowercase    ):



						'''simple docstring'''


						_lowerCamelCase:    List[str]      =    '''segformer'''


						def __init__( self     :      Any  ,A_     :      List[Any]=3  ,A_     :      str=4  ,A_     :      Dict=[2, 2, 2, 2]  ,A_     :      str=[8, 4, 2, 1]  ,A_     :      List[Any]=[32, 64, 160, 256]  ,A_     :      Dict=[7, 3, 3, 3]  ,A_     :      Optional[int]=[4, 2, 2, 2]  ,A_     :      int=[1, 2, 5, 8]  ,A_     :      List[str]=[4, 4, 4, 4]  ,A_     :      int="gelu"  ,A_     :      Optional[int]=0.0  ,A_     :      str=0.0  ,A_     :      Any=0.1  ,A_     :      Dict=0.02  ,A_     :      List[str]=0.1  ,A_     :      List[str]=1e-6  ,A_     :      Tuple=256  ,A_     :      List[Any]=255  ,**A_     :      Any  ,)     ->   Any:
							super().__init__(**A_      )

							if "reshape_last_stage" in kwargs and kwargs["reshape_last_stage"] is False:
								warnings.warn(
								    'Reshape_last_stage is set to False in this config. This argument is deprecated and will soon be'
								    ' removed, as the behaviour will default to that of reshape_last_stage = True.'  ,A_  ,)

							A						   =   num_channels
							A						   =   num_encoder_blocks
							A						   =   depths
							A						   =   sr_ratios
							A						   =   hidden_sizes
							A						   =   patch_sizes
							A						   =   strides
							A						   =   mlp_ratios
							A						   =   num_attention_heads
							A						   =   hidden_act
							A						   =   hidden_dropout_prob
							A						   =   attention_probs_dropout_prob
							A						   =   classifier_dropout_prob
							A						   =   initializer_range
							A						   =   drop_path_rate
							A						   =   layer_norm_eps
							A						   =   decoder_hidden_size
							A						   =   kwargs.get('reshape_last_stage'  ,A_      )
							A						   =   semantic_loss_ignore_index







class 				lowerCAmelCase_				(      _lowercase    ):



						'''simple docstring'''


						_lowerCamelCase:    Optional[Any]      =    version.parse('''1.11'''    )


						@property
						def 						_SCREAMING_SNAKE_CASE      ( self     :      Any      )     ->   Mapping[str, Mapping[int, str]]:
							return OrderedDict(
							    [
							        ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
							    ]      )


						@property
						def 						_SCREAMING_SNAKE_CASE      ( self     :      List[Any]      )     ->   float:
							return 1e-4




						@property
						def 						_SCREAMING_SNAKE_CASE      ( self     :      List[Any]      )     ->   int:
							return 12

"""simple docstring"""


from collections import OrderedDict
from typing import Mapping

from packaging import version

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


_lowercase							   =				logging.get_logger(__name__)

_lowercase							   =				{
    '''hustvl/yolos-small''': '''https://huggingface.co/hustvl/yolos-small/resolve/main/config.json''',
    # See all YOLOS models at https://huggingface.co/models?filter=yolos
}







class 				lowerCAmelCase_				(      _lowercase    ):



						'''simple docstring'''


						_lowerCamelCase:    List[str]      =    '''yolos'''


						def __init__( self     :      Dict  ,A_     :      Optional[Any]=768  ,A_     :      int=12  ,A_     :      List[str]=12  ,A_     :      str=3072  ,A_     :      Tuple="gelu"  ,A_     :      Dict=0.0  ,A_     :      List[Any]=0.0  ,A_     :      Any=0.02  ,A_     :      str=1e-12  ,A_     :      List[Any]=[512, 864]  ,A_     :      Union[str, Any]=16  ,A_     :      List[str]=3  ,A_     :      Optional[int]=True  ,A_     :      Tuple=100  ,A_     :      str=True  ,A_     :      Optional[Any]=False  ,A_     :      Any=1  ,A_     :      Optional[Any]=5  ,A_     :      Optional[Any]=2  ,A_     :      Optional[int]=5  ,A_     :      List[Any]=2  ,A_     :      Union[str, Any]=0.1  ,**A_     :      Tuple  ,)     ->   Any:
							super().__init__(**A_      )

							A						   =   hidden_size
							A						   =   num_hidden_layers
							A						   =   num_attention_heads
							A						   =   intermediate_size
							A						   =   hidden_act
							A						   =   hidden_dropout_prob
							A						   =   attention_probs_dropout_prob
							A						   =   initializer_range
							A						   =   layer_norm_eps
							A						   =   image_size
							A						   =   patch_size
							A						   =   num_channels
							A						   =   qkv_bias
							A						   =   num_detection_tokens
							A						   =   use_mid_position_embeddings
							A						   =   auxiliary_loss
							# Hungarian matcher
							A						   =   class_cost
							A						   =   bbox_cost
							A						   =   giou_cost
							# Loss coefficients
							A						   =   bbox_loss_coefficient
							A						   =   giou_loss_coefficient
							A						   =   eos_coefficient







class 				lowerCAmelCase_				(      _lowercase    ):



						'''simple docstring'''


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


						@property
						def 						_SCREAMING_SNAKE_CASE      ( self     :      Optional[int]      )     ->   Mapping[str, Mapping[int, str]]:
							return OrderedDict(
							    [
							        ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
							    ]      )


						@property
						def 						_SCREAMING_SNAKE_CASE      ( self     :      Any      )     ->   float:
							return 1e-4




						@property
						def 						_SCREAMING_SNAKE_CASE      ( self     :      Tuple      )     ->   int:
							return 12