






from typing import TYPE_CHECKING

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


__snake_case							 =  {
    """configuration_sam""": [
        """SAM_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """SamConfig""",
        """SamMaskDecoderConfig""",
        """SamPromptEncoderConfig""",
        """SamVisionConfig""",
    ],
    """processing_sam""": ["""SamProcessor"""],
}


try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __snake_case							 =  [
     """SAM_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """SamModel""",
     """SamPreTrainedModel""",
 ]
try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __snake_case							 =  [
     """TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """TFSamModel""",
     """TFSamPreTrainedModel""",
 ]
try:
 if not is_vision_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __snake_case							 =  ["""SamImageProcessor"""]


if TYPE_CHECKING:
 from .configuration_sam import (
     SAM_PRETRAINED_CONFIG_ARCHIVE_MAP,
     SamConfig,
     SamMaskDecoderConfig,
     SamPromptEncoderConfig,
     SamVisionConfig,
 )
 from .processing_sam import SamProcessor

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_sam import SAM_PRETRAINED_MODEL_ARCHIVE_LIST, SamModel, SamPreTrainedModel

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_sam import TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST, TFSamModel, TFSamPreTrainedModel

 try:
  if not is_vision_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .image_processing_sam import SamImageProcessor

else:
 import sys

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













from __future__ import annotations

from enum import Enum







class       UpperCAmelCase_						( lowercase			):



      """simple docstring"""
      UpperCamelCase_    : Optional[Any]									=24
      UpperCamelCase_    : Any									=21
      UpperCamelCase_    : Union[str, Any]									=18
      UpperCamelCase_    : Tuple									=15
      UpperCamelCase_    : List[Any]									=12
      UpperCamelCase_    : Optional[Any]									=9
      UpperCamelCase_    : List[str]									=6
      UpperCamelCase_    : List[str]									=3
      UpperCamelCase_    : Any									=2
      UpperCamelCase_    : List[str]									=1
      UpperCamelCase_    : Optional[Any]									=-1
      UpperCamelCase_    : str									=-2
      UpperCamelCase_    : Any									=-3
      UpperCamelCase_    : Optional[int]									=-6
      UpperCamelCase_    : int									=-9
      UpperCamelCase_    : Optional[int]									=-12
      UpperCamelCase_    : Optional[Any]									=-15
      UpperCamelCase_    : str									=-18
      UpperCamelCase_    : int									=-21
      UpperCamelCase_    : Union[str, Any]									=-24







class       UpperCAmelCase_						( lowercase			):



      """simple docstring"""
      UpperCamelCase_    : Tuple									=8
      UpperCamelCase_    : str									=7
      UpperCamelCase_    : List[str]									=6
      UpperCamelCase_    : List[str]									=5
      UpperCamelCase_    : int									=4
      UpperCamelCase_    : Optional[Any]									=3
      UpperCamelCase_    : Optional[Any]									=2
      UpperCamelCase_    : List[str]									=1







def   _A       (    SCREAMING_SNAKE_CASE__  :     float					,  SCREAMING_SNAKE_CASE__  :     str | SIUnit					,  SCREAMING_SNAKE_CASE__  :     str | SIUnit					,  ):
    if isinstance(SCREAMING_SNAKE_CASE__					,  SCREAMING_SNAKE_CASE__	):
        UpperCamelCase	:str     							=       SIUnit[known_prefix.lower()]
    if isinstance(SCREAMING_SNAKE_CASE__					,  SCREAMING_SNAKE_CASE__	):
        UpperCamelCase	:Any     							=       SIUnit[unknown_prefix.lower()]
    UpperCamelCase	:float     							=       known_amount * (
        10 ** (known_prefix.value - unknown_prefix.value)
    )
    return unknown_amount


def   _A       (    SCREAMING_SNAKE_CASE__  :     float					,  SCREAMING_SNAKE_CASE__  :     str | BinaryUnit					,  SCREAMING_SNAKE_CASE__  :     str | BinaryUnit					,  ):
    if isinstance(SCREAMING_SNAKE_CASE__					,  SCREAMING_SNAKE_CASE__	):
        UpperCamelCase	:Dict     							=       BinaryUnit[known_prefix.lower()]
    if isinstance(SCREAMING_SNAKE_CASE__					,  SCREAMING_SNAKE_CASE__	):
        UpperCamelCase	:List[str]     							=       BinaryUnit[unknown_prefix.lower()]
    UpperCamelCase	:float     							=       known_amount * (
        2 ** ((known_prefix.value - unknown_prefix.value) * 10)
    )
    return unknown_amount


if __name__ == "__main__":
 import doctest

 doctest.testmod()





