



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


a_			=					logging.get_logger(__name__)

a_			=					{
    """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     (	lowerCAmelCase__   ):
 lowerCAmelCase__       					=  """segformer"""




 def __init__(						self	,				__UpperCAmelCase=3	,				__UpperCAmelCase=4	,				__UpperCAmelCase=[2, 2, 2, 2]	,				__UpperCAmelCase=[8, 4, 2, 1]	,				__UpperCAmelCase=[32, 64, 160, 256]	,				__UpperCAmelCase=[7, 3, 3, 3]	,				__UpperCAmelCase=[4, 2, 2, 2]	,				__UpperCAmelCase=[1, 2, 5, 8]	,				__UpperCAmelCase=[4, 4, 4, 4]	,				__UpperCAmelCase="gelu"	,				__UpperCAmelCase=0.0	,				__UpperCAmelCase=0.0	,				__UpperCAmelCase=0.1	,				__UpperCAmelCase=0.02	,				__UpperCAmelCase=0.1	,				__UpperCAmelCase=1E-6	,				__UpperCAmelCase=256	,				__UpperCAmelCase=255	,				**__UpperCAmelCase	,				):



    '''simple docstring'''
    super().__init__(**__UpperCAmelCase				)

    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.'''	,				__UpperCAmelCase	,				)

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



class  __lowerCAmelCase     (	lowerCAmelCase__   ):
 lowerCAmelCase__       					=  version.parse("""1.11"""   )




 @property
 def        lowerCamelCase      (						self				):



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




 @property
 def        lowerCamelCase      (						self				):



    '''simple docstring'''
    return 1E-4




 @property
 def        lowerCamelCase      (						self				):



    '''simple docstring'''
    return 12











from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a_			=					{
    """configuration_clipseg""": [
        """CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """CLIPSegConfig""",
        """CLIPSegTextConfig""",
        """CLIPSegVisionConfig""",
    ],
    """processing_clipseg""": ["""CLIPSegProcessor"""],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a_			=					[
      """CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """CLIPSegModel""",
      """CLIPSegPreTrainedModel""",
      """CLIPSegTextModel""",
      """CLIPSegVisionModel""",
      """CLIPSegForImageSegmentation""",
  ]

if TYPE_CHECKING:
  from .configuration_clipseg import (
      CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP,
      CLIPSegConfig,
      CLIPSegTextConfig,
      CLIPSegVisionConfig,
  )
  from .processing_clipseg import CLIPSegProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_clipseg import (
        CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST,
        CLIPSegForImageSegmentation,
        CLIPSegModel,
        CLIPSegPreTrainedModel,
        CLIPSegTextModel,
        CLIPSegVisionModel,
    )

else:
  import sys

  a_			=					_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)






