


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


__SCREAMING_SNAKE_CASE	:							List[Any]           =  logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE	:							Union[str, Any]           =  {
    "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        __lowerCamelCase      (				_SCREAMING_SNAKE_CASE ):


				"""simple docstring"""







				a_:		int					      =	"mobilevit"






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

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

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


class        __lowerCamelCase      (				_SCREAMING_SNAKE_CASE ):


				"""simple docstring"""







				a_:		Dict					      =	version.parse("""1.11""" )






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






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






				@property
				def        lowerCAmelCase__			(				self     :    Optional[Any]					):
								return 1e-4



from dataclasses import dataclass
from typing import List, Optional, Union

import numpy as np
import PIL

from ...utils import BaseOutput, is_invisible_watermark_available, is_torch_available, is_transformers_available


@dataclass
class 							lowercase   (						_SCREAMING_SNAKE_CASE  ):
		__lowercase			:			Union[List[PIL.Image.Image], np.ndarray]


if is_transformers_available() and is_torch_available() and is_invisible_watermark_available():
					from .pipeline_stable_diffusion_xl import StableDiffusionXLPipeline
					from .pipeline_stable_diffusion_xl_imgaimg import StableDiffusionXLImgaImgPipeline
