

import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase_									=    logging.get_logger(__name__)

lowercase_									=    {
    "facebook/sam-vit-huge": "https://huggingface.co/facebook/sam-vit-huge/resolve/main/config.json",
    "facebook/sam-vit-large": "https://huggingface.co/facebook/sam-vit-large/resolve/main/config.json",
    "facebook/sam-vit-base": "https://huggingface.co/facebook/sam-vit-base/resolve/main/config.json",
}


class 					A		(				_UpperCAmelCase					):







    """simple docstring"""





    def __init__( self					:			Dict,lowercase_					:			List[Any]=2_5_6,lowercase_					:			Dict=1_0_2_4,lowercase_					:			List[str]=1_6,lowercase_					:			List[str]=1_6,lowercase_					:			Optional[int]=4,lowercase_					:			str="gelu",lowercase_					:			Optional[int]=1E-6,**lowercase_					:			Optional[Any],)->       Union[str, Any]:





        '''simple docstring'''







        super().__init__(**lowercase_						)
        A__        =  hidden_size
        A__        =  image_size
        A__        =  patch_size
        A__        =  image_size // patch_size
        A__        =  mask_input_channels
        A__        =  num_point_embeddings
        A__        =  hidden_act
        A__        =  layer_norm_eps




class 					A		(				_UpperCAmelCase					):







    """simple docstring"""





    def __init__( self					:			int,lowercase_					:			Optional[int]=2_5_6,lowercase_					:			Tuple="relu",lowercase_					:			Optional[int]=2_0_4_8,lowercase_					:			Tuple=2,lowercase_					:			Dict=8,lowercase_					:			List[str]=2,lowercase_					:			str=3,lowercase_					:			List[str]=3,lowercase_					:			Any=2_5_6,lowercase_					:			Union[str, Any]=1E-6,**lowercase_					:			List[Any],)->       List[Any]:





        '''simple docstring'''







        super().__init__(**lowercase_						)
        A__        =  hidden_size
        A__        =  hidden_act
        A__        =  mlp_dim
        A__        =  num_hidden_layers
        A__        =  num_attention_heads
        A__        =  attention_downsample_rate
        A__        =  num_multimask_outputs
        A__        =  iou_head_depth
        A__        =  iou_head_hidden_dim
        A__        =  layer_norm_eps




class 					A		(				_UpperCAmelCase					):







    """simple docstring"""





    def __init__( self					:			List[str],lowercase_					:			str=7_6_8,lowercase_					:			int=2_5_6,lowercase_					:			str=1_2,lowercase_					:			Tuple=1_2,lowercase_					:			str=3,lowercase_					:			str=1_0_2_4,lowercase_					:			Dict=1_6,lowercase_					:			List[str]="gelu",lowercase_					:			int=1E-06,lowercase_					:			Dict=0.0,lowercase_					:			int=1E-10,lowercase_					:			Any=True,lowercase_					:			List[Any]=4.0,lowercase_					:			str=True,lowercase_					:			Any=True,lowercase_					:			Union[str, Any]=1_4,lowercase_					:			List[Any]=[2, 5, 8, 1_1],lowercase_					:			Optional[int]=1_2_8,lowercase_					:			str=None,**lowercase_					:			Any,)->       List[str]:





        '''simple docstring'''







        super().__init__(**lowercase_						)

        A__        =  hidden_size
        A__        =  output_channels
        A__        =  num_hidden_layers
        A__        =  num_attention_heads
        A__        =  num_channels
        A__        =  image_size
        A__        =  patch_size
        A__        =  hidden_act
        A__        =  layer_norm_eps
        A__        =  attention_dropout
        A__        =  initializer_range
        A__        =  qkv_bias
        A__        =  mlp_ratio
        A__        =  use_abs_pos
        A__        =  use_rel_pos
        A__        =  window_size
        A__        =  global_attn_indexes
        A__        =  num_pos_feats
        A__        =  int(hidden_size * mlp_ratio						) if mlp_dim is None else mlp_dim




class 					A		(				_UpperCAmelCase					):







    """simple docstring"""





    lowerCamelCase						      =				'sam'
    lowerCamelCase						      =				True


    def __init__( self					:			Union[str, Any],lowercase_					:			Tuple=None,lowercase_					:			Optional[Any]=None,lowercase_					:			Union[str, Any]=None,lowercase_					:			Union[str, Any]=0.02,**lowercase_					:			Dict,)->       Any:





        '''simple docstring'''







        super().__init__(**lowercase_						)
        A__        =  vision_config if vision_config is not None else {}
        A__        =  prompt_encoder_config if prompt_encoder_config is not None else {}
        A__        =  mask_decoder_config if mask_decoder_config is not None else {}

        if isinstance(lowercase_,lowercase_						):
            A__        =  vision_config.to_dict()
        if isinstance(lowercase_,lowercase_						):
            A__        =  prompt_encoder_config.to_dict()
        if isinstance(lowercase_,lowercase_						):
            A__        =  mask_decoder_config.to_dict()

        A__        =  SamVisionConfig(**lowercase_						)
        A__        =  SamPromptEncoderConfig(**lowercase_						)
        A__        =  SamMaskDecoderConfig(**lowercase_						)
        A__        =  initializer_range


    def 		snake_case__	( self					:			List[str]						)->       Any:





        '''simple docstring'''







        A__        =  copy.deepcopy(self.__dict__						)
        A__        =  self.vision_config.to_dict()
        A__        =  self.prompt_encoder_config.to_dict()
        A__        =  self.mask_decoder_config.to_dict()
        A__        =  self.__class__.model_type
        return output




import warnings

from ...utils import logging
from .image_processing_mobilenet_va import MobileNetVaImageProcessor


lowercase_									=    logging.get_logger(__name__)


class 					A		(				_UpperCAmelCase					):







    """simple docstring"""





    def __init__( self					:			str,*lowercase_					:			List[Any],**lowercase_					:			Dict						)->       None:





        '''simple docstring'''







        warnings.warn(
            'The class MobileNetV1FeatureExtractor is deprecated and will be removed in version 5 of Transformers.'
            ' Please use MobileNetV1ImageProcessor instead.',lowercase_,)
        super().__init__(*lowercase_,**lowercase_						)

