





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										=					logging.get_logger(__name__)

_UpperCAmelCase										=					{
    'apple/mobilevit-small': 'https://huggingface.co/apple/mobilevit-small/resolve/main/config.json',
    'apple/mobilevit-x-small': 'https://huggingface.co/apple/mobilevit-x-small/resolve/main/config.json',
    'apple/mobilevit-xx-small': 'https://huggingface.co/apple/mobilevit-xx-small/resolve/main/config.json',
    'apple/deeplabv3-mobilevit-small': (
        'https://huggingface.co/apple/deeplabv3-mobilevit-small/resolve/main/config.json'
    ),
    'apple/deeplabv3-mobilevit-x-small': (
        'https://huggingface.co/apple/deeplabv3-mobilevit-x-small/resolve/main/config.json'
    ),
    'apple/deeplabv3-mobilevit-xx-small': (
        'https://huggingface.co/apple/deeplabv3-mobilevit-xx-small/resolve/main/config.json'
    ),
    # See all MobileViT models at https://huggingface.co/models?filter=mobilevit
}



class 				_UpperCamelCase       (						lowerCAmelCase_  ):
       _UpperCamelCase					:       Dict       = '''mobilevit'''

       def __init__(		self:			Optional[int]       , _SCREAMING_SNAKE_CASE:			Tuple=3       , _SCREAMING_SNAKE_CASE:			List[str]=256       , _SCREAMING_SNAKE_CASE:			List[str]=2       , _SCREAMING_SNAKE_CASE:			Union[str, Any]=[144, 192, 240]       , _SCREAMING_SNAKE_CASE:			Union[str, Any]=[16, 32, 64, 96, 128, 160, 640]       , _SCREAMING_SNAKE_CASE:			int=4       , _SCREAMING_SNAKE_CASE:			List[str]=2.0       , _SCREAMING_SNAKE_CASE:			Optional[int]=4.0       , _SCREAMING_SNAKE_CASE:			Optional[int]="silu"       , _SCREAMING_SNAKE_CASE:			Optional[int]=3       , _SCREAMING_SNAKE_CASE:			Any=32       , _SCREAMING_SNAKE_CASE:			int=0.1       , _SCREAMING_SNAKE_CASE:			Optional[int]=0.0       , _SCREAMING_SNAKE_CASE:			List[Any]=0.1       , _SCREAMING_SNAKE_CASE:			Optional[int]=0.02       , _SCREAMING_SNAKE_CASE:			Tuple=1e-5       , _SCREAMING_SNAKE_CASE:			str=True       , _SCREAMING_SNAKE_CASE:			Any=256       , _SCREAMING_SNAKE_CASE:			List[str]=[6, 12, 18]       , _SCREAMING_SNAKE_CASE:			Any=0.1       , _SCREAMING_SNAKE_CASE:			Optional[Any]=255       , **_SCREAMING_SNAKE_CASE:			Union[str, Any]       , )							->			List[str]:




              """simple docstring"""


              super().__init__(**_SCREAMING_SNAKE_CASE		)

              UpperCamelCase_ 							=	num_channels
              UpperCamelCase_ 							=	image_size
              UpperCamelCase_ 							=	patch_size
              UpperCamelCase_ 							=	hidden_sizes
              UpperCamelCase_ 							=	neck_hidden_sizes
              UpperCamelCase_ 							=	num_attention_heads
              UpperCamelCase_ 							=	mlp_ratio
              UpperCamelCase_ 							=	expand_ratio
              UpperCamelCase_ 							=	hidden_act
              UpperCamelCase_ 							=	conv_kernel_size
              UpperCamelCase_ 							=	output_stride
              UpperCamelCase_ 							=	hidden_dropout_prob
              UpperCamelCase_ 							=	attention_probs_dropout_prob
              UpperCamelCase_ 							=	classifier_dropout_prob
              UpperCamelCase_ 							=	initializer_range
              UpperCamelCase_ 							=	layer_norm_eps
              UpperCamelCase_ 							=	qkv_bias

              # decode head attributes for semantic segmentation
              UpperCamelCase_ 							=	aspp_out_channels
              UpperCamelCase_ 							=	atrous_rates
              UpperCamelCase_ 							=	aspp_dropout_prob
              UpperCamelCase_ 							=	semantic_loss_ignore_index



class 				_UpperCamelCase       (						lowerCAmelCase_  ):
       _UpperCamelCase					:       Dict       = version.parse('''1.11'''  )

       @property
       def lowercase			(		self:			List[str]		)							->			Mapping[str, Mapping[int, str]]:




              """simple docstring"""


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

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




              """simple docstring"""


              if self.task == "image-classification":
                     return OrderedDict([("logits", {0: "batch"})]		)
              else:
                     return OrderedDict([("last_hidden_state", {0: "batch"}), ("pooler_output", {0: "batch"})]		)



       @property
       def lowercase			(		self:			Union[str, Any]		)							->			float:




              """simple docstring"""


              return 1e-4


"""simple docstring"""

from typing import TYPE_CHECKING

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


__lowercase    =				{
    '''configuration_videomae''': ['''VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''VideoMAEConfig'''],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__lowercase    =				[
				    '''VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''VideoMAEForPreTraining''',
				    '''VideoMAEModel''',
				    '''VideoMAEPreTrainedModel''',
				    '''VideoMAEForVideoClassification''',
				]

try:
				if not is_vision_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__lowercase    =				['''VideoMAEFeatureExtractor''']
				__lowercase    =				['''VideoMAEImageProcessor''']

if TYPE_CHECKING:
				from .configuration_videomae import VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP, VideoMAEConfig

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_videomae import (
								    VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST,
								    VideoMAEForPreTraining,
								    VideoMAEForVideoClassification,
								    VideoMAEModel,
								    VideoMAEPreTrainedModel,
								)

				try:
								if not is_vision_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .feature_extraction_videomae import VideoMAEFeatureExtractor
								from .image_processing_videomae import VideoMAEImageProcessor

else:
				import sys

				__lowercase    =				_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



