





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


lowercase__						:			str       =				{
    """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:
   lowercase__						:			Optional[Any]       =				["""OwlViTFeatureExtractor"""]
   lowercase__						:			Optional[int]       =				["""OwlViTImageProcessor"""]

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   lowercase__						:			Union[str, Any]       =				[
       """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

   lowercase__						:			Union[str, Any]       =				_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)










from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


__lowerCamelCase       :     str   =     logging.get_logger(__name__)

__lowerCamelCase       :     str   =     {
    """facebook/convnextv2-tiny-1k-224""": """https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json""",
}



class 					A__   (       __snake_case       ,   __snake_case			):
      _UpperCAmelCase	:Optional[int]						    =   'convnextv2'





      def __init__( self       ,							A_=3       ,							A_=4       ,							A_=4       ,							A_=None       ,							A_=None       ,							A_="gelu"       ,							A_=0.02       ,							A_=1e-12       ,							A_=0.0       ,							A_=224       ,							A_=None       ,							A_=None       ,							**A_       ,							):
       '''simple docstring'''




       super().__init__(**A_   )

       UpperCamelCase	:					Dict       	=   num_channels
       UpperCamelCase	:					Union[str, Any]       	=   patch_size
       UpperCamelCase	:					Union[str, Any]       	=   num_stages
       UpperCamelCase	:					List[Any]       	=   [96, 192, 384, 768] if hidden_sizes is None else hidden_sizes
       UpperCamelCase	:					List[str]       	=   [3, 3, 9, 3] if depths is None else depths
       UpperCamelCase	:					Dict       	=   hidden_act
       UpperCamelCase	:					Union[str, Any]       	=   initializer_range
       UpperCamelCase	:					Tuple       	=   layer_norm_eps
       UpperCamelCase	:					str       	=   drop_path_rate
       UpperCamelCase	:					List[str]       	=   image_size
       UpperCamelCase	:					List[str]       	=   ["stem"] + [F"""stage{idx}""" for idx in range(1       ,							len(self.depths   ) + 1   )]
       UpperCamelCase	,    UpperCamelCase	:					str       	=   get_aligned_output_features_output_indices(
           out_features=A_       ,							out_indices=A_       ,							stage_names=self.stage_names   )
