





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


UpperCAmelCase						:       Optional[Any]        =					{
    '''configuration_deta''': ['''DETA_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''DetaConfig'''],
}

try:
    if not is_vision_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    UpperCAmelCase						:       Any        =					['''DetaImageProcessor''']

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    UpperCAmelCase						:       List[Any]        =					[
        '''DETA_PRETRAINED_MODEL_ARCHIVE_LIST''',
        '''DetaForObjectDetection''',
        '''DetaModel''',
        '''DetaPreTrainedModel''',
    ]


if TYPE_CHECKING:
    from .configuration_deta import DETA_PRETRAINED_CONFIG_ARCHIVE_MAP, DetaConfig

    try:
        if not is_vision_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .image_processing_deta import DetaImageProcessor

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_deta import (
            DETA_PRETRAINED_MODEL_ARCHIVE_LIST,
            DetaForObjectDetection,
            DetaModel,
            DetaPreTrainedModel,
        )

else:
    import sys

    UpperCAmelCase						:       List[Any]        =					_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)











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


UpperCAmelCase						:       str        =					logging.get_logger(__name__)

UpperCAmelCase						:       Optional[Any]        =					{
    '''MBZUAI/swiftformer-xs''': '''https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json''',
}





class 						_A( snake_case__       ):


				"""simple docstring"""


				UpperCamelCase   :  Union[str, Any]    =     '''swiftformer'''



				def __init__(      self					, _A=3					, _A=[3, 3, 6, 4]					, _A=[48, 56, 112, 220]					, _A=4					, _A=[True, True, True, True]					, _A="gelu"					, _A=3					, _A=2					, _A=1					, _A=0.0					, _A=True					, _A=1e-5					, _A=1e-5					, **_A					, ):
									super().__init__(**_A					)
									__A     :						List[Any]          =    num_channels
									__A     :						List[Any]          =    depths
									__A     :						int          =    embed_dims
									__A     :						Union[str, Any]          =    mlp_ratio
									__A     :						List[str]          =    downsamples
									__A     :						str          =    hidden_act
									__A     :						Any          =    down_patch_size
									__A     :						Any          =    down_stride
									__A     :						Any          =    down_pad
									__A     :						List[Any]          =    drop_path_rate
									__A     :						str          =    use_layer_scale
									__A     :						Dict          =    layer_scale_init_value
									__A     :						Union[str, Any]          =    batch_norm_eps





class 						_A( snake_case__       ):


				"""simple docstring"""


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



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





				@property
				def  UpperCAmelCase_		(      self					):
									return 1e-4




