




"""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


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       lowercase(  __a				):







 '''simple docstring'''





 lowercase__				      =      "segformer"


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




   '''simple docstring'''



   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_,   )

   _snake_case							:	Union[str, Any]			=						num_channels
   _snake_case							:	Tuple			=						num_encoder_blocks
   _snake_case							:	Dict			=						depths
   _snake_case							:	Dict			=						sr_ratios
   _snake_case							:	Tuple			=						hidden_sizes
   _snake_case							:	Dict			=						patch_sizes
   _snake_case							:	List[str]			=						strides
   _snake_case							:	Optional[int]			=						mlp_ratios
   _snake_case							:	List[Any]			=						num_attention_heads
   _snake_case							:	List[Any]			=						hidden_act
   _snake_case							:	Dict			=						hidden_dropout_prob
   _snake_case							:	int			=						attention_probs_dropout_prob
   _snake_case							:	Union[str, Any]			=						classifier_dropout_prob
   _snake_case							:	str			=						initializer_range
   _snake_case							:	Optional[int]			=						drop_path_rate
   _snake_case							:	Tuple			=						layer_norm_eps
   _snake_case							:	Tuple			=						decoder_hidden_size
   _snake_case							:	Optional[Any]			=						kwargs.get("""reshape_last_stage""",   a_	)
   _snake_case							:	Any			=						semantic_loss_ignore_index







class       lowercase(  __a				):







 '''simple docstring'''





 lowercase__				      =      version.parse("1.11"				)


 @property
 def 				UpperCamelCase_     (       self:	Optional[int]	):




   '''simple docstring'''



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


 @property
 def 				UpperCamelCase_     (       self:	Union[str, Any]	):




   '''simple docstring'''



   return 1E-4


 @property
 def 				UpperCamelCase_     (       self:	Optional[Any]	):




   '''simple docstring'''



   return 12








"""simple docstring"""


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


A_      			=       {
    '''configuration_owlvit''': [
        '''OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''OwlViTConfig''',
        '''OwlViTOnnxConfig''',
        '''OwlViTTextConfig''',
        '''OwlViTVisionConfig''',
    ],
    '''processing_owlvit''': ['''OwlViTProcessor'''],
}


try:
     if not is_vision_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     A_      			=       ['''OwlViTFeatureExtractor''']
     A_      			=       ['''OwlViTImageProcessor''']

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     A_      			=       [
         '''OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
         '''OwlViTModel''',
         '''OwlViTPreTrainedModel''',
         '''OwlViTTextModel''',
         '''OwlViTVisionModel''',
         '''OwlViTForObjectDetection''',
     ]

if TYPE_CHECKING:
     from .configuration_owlvit import (
         OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP,
         OwlViTConfig,
         OwlViTOnnxConfig,
         OwlViTTextConfig,
         OwlViTVisionConfig,
     )
     from .processing_owlvit import OwlViTProcessor

     try:
          if not is_vision_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .feature_extraction_owlvit import OwlViTFeatureExtractor
          from .image_processing_owlvit import OwlViTImageProcessor

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_owlvit import (
              OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
              OwlViTForObjectDetection,
              OwlViTModel,
              OwlViTPreTrainedModel,
              OwlViTTextModel,
              OwlViTVisionModel,
          )

else:
     import sys

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


