



'''simple docstring'''





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


_lowerCAmelCase										=     logging.get_logger(__name__)

_lowerCAmelCase										=     {
    '''google/mobilenet_v2_1.4_224''': '''https://huggingface.co/google/mobilenet_v2_1.4_224/resolve/main/config.json''',
    '''google/mobilenet_v2_1.0_224''': '''https://huggingface.co/google/mobilenet_v2_1.0_224/resolve/main/config.json''',
    '''google/mobilenet_v2_0.75_160''': '''https://huggingface.co/google/mobilenet_v2_0.75_160/resolve/main/config.json''',
    '''google/mobilenet_v2_0.35_96''': '''https://huggingface.co/google/mobilenet_v2_0.35_96/resolve/main/config.json''',
    # See all MobileNetV2 models at https://huggingface.co/models?filter=mobilenet_v2
}






class 	lowerCAmelCase_(    __snake_case					):
  '''simple docstring'''




  __lowercase							:				Optional[Any]           =				'mobilenet_v2'




  def __init__(   self  ,__UpperCAmelCase=3  ,__UpperCAmelCase=224  ,__UpperCAmelCase=1.0  ,__UpperCAmelCase=8  ,__UpperCAmelCase=8  ,__UpperCAmelCase=6  ,__UpperCAmelCase=32  ,__UpperCAmelCase=True  ,__UpperCAmelCase=True  ,__UpperCAmelCase="relu6"  ,__UpperCAmelCase=True  ,__UpperCAmelCase=0.8  ,__UpperCAmelCase=0.0_2  ,__UpperCAmelCase=0.0_0_1  ,__UpperCAmelCase=255  ,**__UpperCAmelCase  ,)   ->		Union[str, Any]:
      super().__init__(**__UpperCAmelCase				)

      if depth_multiplier <= 0:
          raise ValueError("""depth_multiplier must be greater than zero."""				)

      lowerCAmelCase__			:  List[str]											= num_channels
      lowerCAmelCase__			:  Optional[Any]											= image_size
      lowerCAmelCase__			:  Union[str, Any]											= depth_multiplier
      lowerCAmelCase__			:  int											= depth_divisible_by
      lowerCAmelCase__			:  Optional[Any]											= min_depth
      lowerCAmelCase__			:  Optional[Any]											= expand_ratio
      lowerCAmelCase__			:  Optional[Any]											= output_stride
      lowerCAmelCase__			:  int											= first_layer_is_expansion
      lowerCAmelCase__			:  Optional[int]											= finegrained_output
      lowerCAmelCase__			:  int											= hidden_act
      lowerCAmelCase__			:  Any											= tf_padding
      lowerCAmelCase__			:  Union[str, Any]											= classifier_dropout_prob
      lowerCAmelCase__			:  Any											= initializer_range
      lowerCAmelCase__			:  Dict											= layer_norm_eps
      lowerCAmelCase__			:  Dict											= semantic_loss_ignore_index







class 	lowerCAmelCase_(    __snake_case					):
  '''simple docstring'''




  __lowercase							:				Dict           =				version.parse('''1.11'''					)




  @property
  def 							UpperCAmelCase_     (   self				)   ->		Mapping[str, Mapping[int, str]]:
      return OrderedDict([("""pixel_values""", {0: """batch"""})]				)




  @property
  def 							UpperCAmelCase_     (   self				)   ->		Mapping[str, Mapping[int, 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 							UpperCAmelCase_     (   self				)   ->		float:
      return 1E-4







'''simple docstring'''





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowerCAmelCase										=     {
    '''configuration_blip_2''': [
        '''BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''Blip2Config''',
        '''Blip2QFormerConfig''',
        '''Blip2VisionConfig''',
    ],
    '''processing_blip_2''': ['''Blip2Processor'''],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _lowerCAmelCase										=     [
     '''BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST''',
     '''Blip2Model''',
     '''Blip2QFormerModel''',
     '''Blip2PreTrainedModel''',
     '''Blip2ForConditionalGeneration''',
     '''Blip2VisionModel''',
 ]

if TYPE_CHECKING:
 from .configuration_blip_a import (
     BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP,
     BlipaConfig,
     BlipaQFormerConfig,
     BlipaVisionConfig,
 )
 from .processing_blip_a import BlipaProcessor

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_blip_a import (
      BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST,
      BlipaForConditionalGeneration,
      BlipaModel,
      BlipaPreTrainedModel,
      BlipaQFormerModel,
      BlipaVisionModel,
  )

else:
 import sys

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


