



"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


A:   str								=		logging.get_logger(__name__)

A:   List[str]								=		{
    "microsoft/focalnet-tiny": "https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json",
}



class       SCREAMING_SNAKE_CASE__  (					UpperCAmelCase__      ,			UpperCAmelCase__ ):
   __lowerCAmelCase  :   List[Any]						=						'focalnet'

   def __init__(   self      ,     _SCREAMING_SNAKE_CASE=224      ,     _SCREAMING_SNAKE_CASE=4      ,     _SCREAMING_SNAKE_CASE=3      ,     _SCREAMING_SNAKE_CASE=96      ,     _SCREAMING_SNAKE_CASE=False      ,     _SCREAMING_SNAKE_CASE=[192, 384, 768, 768]      ,     _SCREAMING_SNAKE_CASE=[2, 2, 6, 2]      ,     _SCREAMING_SNAKE_CASE=[2, 2, 2, 2]      ,     _SCREAMING_SNAKE_CASE=[3, 3, 3, 3]      ,     _SCREAMING_SNAKE_CASE="gelu"      ,     _SCREAMING_SNAKE_CASE=4.0      ,     _SCREAMING_SNAKE_CASE=0.0      ,     _SCREAMING_SNAKE_CASE=0.1      ,     _SCREAMING_SNAKE_CASE=False      ,     _SCREAMING_SNAKE_CASE=1E-4      ,     _SCREAMING_SNAKE_CASE=False      ,     _SCREAMING_SNAKE_CASE=False      ,     _SCREAMING_SNAKE_CASE=False      ,     _SCREAMING_SNAKE_CASE=0.02      ,     _SCREAMING_SNAKE_CASE=1E-5      ,     _SCREAMING_SNAKE_CASE=32      ,     _SCREAMING_SNAKE_CASE=None      ,     _SCREAMING_SNAKE_CASE=None      ,     **_SCREAMING_SNAKE_CASE      ,     )  ->      Dict:





    '''simple docstring'''




    super().__init__(**_SCREAMING_SNAKE_CASE						)

    UpperCAmelCase	:					Union[str, Any]	=	image_size
    UpperCAmelCase	:					Union[str, Any]	=	patch_size
    UpperCAmelCase	:					Any	=	num_channels
    UpperCAmelCase	:					Optional[int]	=	embed_dim
    UpperCAmelCase	:					List[str]	=	use_conv_embed
    UpperCAmelCase	:					Dict	=	hidden_sizes
    UpperCAmelCase	:					Any	=	depths
    UpperCAmelCase	:					str	=	focal_levels
    UpperCAmelCase	:					Tuple	=	focal_windows
    UpperCAmelCase	:					Tuple	=	hidden_act
    UpperCAmelCase	:					Dict	=	mlp_ratio
    UpperCAmelCase	:					List[Any]	=	hidden_dropout_prob
    UpperCAmelCase	:					Dict	=	drop_path_rate
    UpperCAmelCase	:					Tuple	=	use_layerscale
    UpperCAmelCase	:					Dict	=	layerscale_value
    UpperCAmelCase	:					Optional[int]	=	use_post_layernorm
    UpperCAmelCase	:					Dict	=	use_post_layernorm_in_modulation
    UpperCAmelCase	:					Tuple	=	normalize_modulator
    UpperCAmelCase	:					List[Any]	=	initializer_range
    UpperCAmelCase	:					Union[str, Any]	=	layer_norm_eps
    UpperCAmelCase	:					List[Any]	=	encoder_stride
    UpperCAmelCase	:					Optional[Any]	=	["""stem"""] + [F"stage{idx}" for idx in range(1      ,     len(self.depths						) + 1						)]
    UpperCAmelCase	,		UpperCAmelCase	:					Any	=	get_aligned_output_features_output_indices(
        out_features=_SCREAMING_SNAKE_CASE      ,     out_indices=_SCREAMING_SNAKE_CASE      ,     stage_names=self.stage_names						)





"""simple docstring"""
from typing import TYPE_CHECKING

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


A:   List[str]								=		{"configuration_dpt": ["DPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DPTConfig"]}

try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   Tuple								=		["DPTFeatureExtractor"]
      A:   int								=		["DPTImageProcessor"]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   Optional[Any]								=		[
          "DPT_PRETRAINED_MODEL_ARCHIVE_LIST",
          "DPTForDepthEstimation",
          "DPTForSemanticSegmentation",
          "DPTModel",
          "DPTPreTrainedModel",
      ]


if TYPE_CHECKING:
      from .configuration_dpt import DPT_PRETRAINED_CONFIG_ARCHIVE_MAP, DPTConfig

      try:
            if not is_vision_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .feature_extraction_dpt import DPTFeatureExtractor
            from .image_processing_dpt import DPTImageProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_dpt import (
                DPT_PRETRAINED_MODEL_ARCHIVE_LIST,
                DPTForDepthEstimation,
                DPTForSemanticSegmentation,
                DPTModel,
                DPTPreTrainedModel,
            )


else:
      import sys

      A:   str								=		_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
