


import copy

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


snake_case__  				=			logging.get_logger(__name__)

snake_case__  				=			{
    '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      snake_case__	(   _A	):
				def __init__(	self  ,   _UpperCAmelCase=256  ,   _UpperCAmelCase=1024  ,   _UpperCAmelCase=16  ,   _UpperCAmelCase=16  ,   _UpperCAmelCase=4  ,   _UpperCAmelCase="gelu"  ,   _UpperCAmelCase=1E-6  ,   **_UpperCAmelCase  ,   ):




										"""simple docstring"""




										super().__init__(**_UpperCAmelCase   )
										__magic_name__					:				int				=   hidden_size
										__magic_name__					:				List[Any]				=   image_size
										__magic_name__					:				Union[str, Any]				=   patch_size
										__magic_name__					:				Optional[int]				=   image_size // patch_size
										__magic_name__					:				Any				=   mask_input_channels
										__magic_name__					:				List[str]				=   num_point_embeddings
										__magic_name__					:				Optional[Any]				=   hidden_act
										__magic_name__					:				List[Any]				=   layer_norm_eps






class      snake_case__	(   _A	):
				def __init__(	self  ,   _UpperCAmelCase=256  ,   _UpperCAmelCase="relu"  ,   _UpperCAmelCase=2048  ,   _UpperCAmelCase=2  ,   _UpperCAmelCase=8  ,   _UpperCAmelCase=2  ,   _UpperCAmelCase=3  ,   _UpperCAmelCase=3  ,   _UpperCAmelCase=256  ,   _UpperCAmelCase=1E-6  ,   **_UpperCAmelCase  ,   ):




										"""simple docstring"""




										super().__init__(**_UpperCAmelCase   )
										__magic_name__					:				List[str]				=   hidden_size
										__magic_name__					:				Optional[int]				=   hidden_act
										__magic_name__					:				Dict				=   mlp_dim
										__magic_name__					:				List[Any]				=   num_hidden_layers
										__magic_name__					:				List[str]				=   num_attention_heads
										__magic_name__					:				Tuple				=   attention_downsample_rate
										__magic_name__					:				List[str]				=   num_multimask_outputs
										__magic_name__					:				Tuple				=   iou_head_depth
										__magic_name__					:				Any				=   iou_head_hidden_dim
										__magic_name__					:				Dict				=   layer_norm_eps






class      snake_case__	(   _A	):
				def __init__(	self  ,   _UpperCAmelCase=768  ,   _UpperCAmelCase=256  ,   _UpperCAmelCase=12  ,   _UpperCAmelCase=12  ,   _UpperCAmelCase=3  ,   _UpperCAmelCase=1024  ,   _UpperCAmelCase=16  ,   _UpperCAmelCase="gelu"  ,   _UpperCAmelCase=1E-0_6  ,   _UpperCAmelCase=0.0  ,   _UpperCAmelCase=1E-1_0  ,   _UpperCAmelCase=True  ,   _UpperCAmelCase=4.0  ,   _UpperCAmelCase=True  ,   _UpperCAmelCase=True  ,   _UpperCAmelCase=14  ,   _UpperCAmelCase=[2, 5, 8, 11]  ,   _UpperCAmelCase=128  ,   _UpperCAmelCase=None  ,   **_UpperCAmelCase  ,   ):




										"""simple docstring"""




										super().__init__(**_UpperCAmelCase   )

										__magic_name__					:				Dict				=   hidden_size
										__magic_name__					:				Union[str, Any]				=   output_channels
										__magic_name__					:				Optional[int]				=   num_hidden_layers
										__magic_name__					:				Any				=   num_attention_heads
										__magic_name__					:				Optional[Any]				=   num_channels
										__magic_name__					:				List[str]				=   image_size
										__magic_name__					:				Dict				=   patch_size
										__magic_name__					:				List[Any]				=   hidden_act
										__magic_name__					:				Dict				=   layer_norm_eps
										__magic_name__					:				Dict				=   attention_dropout
										__magic_name__					:				int				=   initializer_range
										__magic_name__					:				Tuple				=   qkv_bias
										__magic_name__					:				Optional[int]				=   mlp_ratio
										__magic_name__					:				List[str]				=   use_abs_pos
										__magic_name__					:				List[str]				=   use_rel_pos
										__magic_name__					:				Union[str, Any]				=   window_size
										__magic_name__					:				Optional[int]				=   global_attn_indexes
										__magic_name__					:				int				=   num_pos_feats
										__magic_name__					:				Union[str, Any]				=   int(hidden_size * mlp_ratio   ) if mlp_dim is None else mlp_dim






class      snake_case__	(   _A	):
				__lowerCAmelCase		=   '''sam'''
				__lowerCAmelCase		=   True
				def __init__(	self  ,   _UpperCAmelCase=None  ,   _UpperCAmelCase=None  ,   _UpperCAmelCase=None  ,   _UpperCAmelCase=0.02  ,   **_UpperCAmelCase  ,   ):




										"""simple docstring"""




										super().__init__(**_UpperCAmelCase   )
										__magic_name__					:				int				=   vision_config if vision_config is not None else {}
										__magic_name__					:				Tuple				=   prompt_encoder_config if prompt_encoder_config is not None else {}
										__magic_name__					:				Dict				=   mask_decoder_config if mask_decoder_config is not None else {}

										if isinstance(_UpperCAmelCase  ,   _UpperCAmelCase   ):
																__magic_name__					:				List[str]				=   vision_config.to_dict()
										if isinstance(_UpperCAmelCase  ,   _UpperCAmelCase   ):
																__magic_name__					:				str				=   prompt_encoder_config.to_dict()
										if isinstance(_UpperCAmelCase  ,   _UpperCAmelCase   ):
																__magic_name__					:				List[Any]				=   mask_decoder_config.to_dict()

										__magic_name__					:				Optional[int]				=   SamVisionConfig(**_UpperCAmelCase   )
										__magic_name__					:				Tuple				=   SamPromptEncoderConfig(**_UpperCAmelCase   )
										__magic_name__					:				str				=   SamMaskDecoderConfig(**_UpperCAmelCase   )
										__magic_name__					:				int				=   initializer_range





				def 			UpperCamelCase_    (	self   ):




										"""simple docstring"""




										__magic_name__					:				Tuple				=   copy.deepcopy(self.__dict__   )
										__magic_name__					:				Dict				=   self.vision_config.to_dict()
										__magic_name__					:				str				=   self.prompt_encoder_config.to_dict()
										__magic_name__					:				str				=   self.mask_decoder_config.to_dict()
										__magic_name__					:				int				=   self.__class__.model_type
										return output






# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

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


snake_case__  				=			{
    'configuration_tvlt': ['TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'TvltConfig'],
    'feature_extraction_tvlt': ['TvltFeatureExtractor'],
    'processing_tvlt': ['TvltProcessor'],
}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			snake_case__  				=			[
			    'TVLT_PRETRAINED_MODEL_ARCHIVE_LIST',
			    'TvltModel',
			    'TvltForPreTraining',
			    'TvltForAudioVisualClassification',
			    'TvltPreTrainedModel',
			]

try:
			if not is_vision_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			snake_case__  				=			['TvltImageProcessor']


if TYPE_CHECKING:
			from .configuration_tvlt import TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP, TvltConfig
			from .processing_tvlt import TvltProcessor
			from .feature_extraction_tvlt import TvltFeatureExtractor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_tvlt import (
						    TVLT_PRETRAINED_MODEL_ARCHIVE_LIST,
						    TvltForAudioVisualClassification,
						    TvltForPreTraining,
						    TvltModel,
						    TvltPreTrainedModel,
						)

			try:
						if not is_vision_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .image_processing_tvlt import TvltImageProcessor


else:
			import sys

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


