


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


snake_case							:	Dict					      =				logging.get_logger(__name__)

snake_case							:	Union[str, Any]					      =				{
    '''google/bit-50''': '''https://huggingface.co/google/bit-50/resolve/main/config.json''',
}







class 	snake_case_       (lowerCamelCase_     ,						lowerCamelCase_				):
					UpperCAmelCase__ :   Tuple   				=      '''bit'''
					UpperCAmelCase__ :   Tuple   				=      ['''preactivation''', '''bottleneck''']
					UpperCAmelCase__ :   Any   				=      ['''SAME''', '''VALID''']
					def __init__(				self       :Optional[int]      ,__snake_case       :Optional[Any]=3      ,__snake_case       :int=64      ,__snake_case       :List[str]=[2_56, 5_12, 10_24, 20_48]      ,__snake_case       :str=[3, 4, 6, 3]      ,__snake_case       :Any="preactivation"      ,__snake_case       :Tuple="relu"      ,__snake_case       :str=None      ,__snake_case       :int=32      ,__snake_case       :Optional[int]=0.0      ,__snake_case       :Optional[Any]=False      ,__snake_case       :List[Any]=32      ,__snake_case       :Tuple=1      ,__snake_case       :List[str]=None      ,__snake_case       :List[str]=None      ,**__snake_case       :Optional[int]      ,) ->   Tuple:
												super().__init__(**__snake_case				)
												if layer_type not in self.layer_types:
																			raise ValueError(F'layer_type={layer_type} is not one of {",".join(self.layer_types				)}'				)
												if global_padding is not None:
																			if global_padding.upper() in self.supported_padding:
																										a__					=					global_padding.upper()
																			else:
																										raise ValueError(F'Padding strategy {global_padding} not supported'				)
												a__					=					num_channels
												a__					=					embedding_size
												a__					=					hidden_sizes
												a__					=					depths
												a__					=					layer_type
												a__					=					hidden_act
												a__					=					global_padding
												a__					=					num_groups
												a__					=					drop_path_rate
												a__					=					embedding_dynamic_padding
												a__					=					output_stride
												a__					=					width_factor

												a__					=					['stem'] + [F'stage{idx}' for idx in range(1      ,len(__snake_case				) + 1				)]
												a__				, a__					=					get_aligned_output_features_output_indices(
												    out_features=__snake_case      ,out_indices=__snake_case      ,stage_names=self.stage_names				)








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


snake_case							:	Optional[int]					      =				{
    '''configuration_clipseg''': [
        '''CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''CLIPSegConfig''',
        '''CLIPSegTextConfig''',
        '''CLIPSegVisionConfig''',
    ],
    '''processing_clipseg''': ['''CLIPSegProcessor'''],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						snake_case							:	List[str]					      =				[
						    '''CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''CLIPSegModel''',
						    '''CLIPSegPreTrainedModel''',
						    '''CLIPSegTextModel''',
						    '''CLIPSegVisionModel''',
						    '''CLIPSegForImageSegmentation''',
						]

if TYPE_CHECKING:
						from .configuration_clipseg import (
						    CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP,
						    CLIPSegConfig,
						    CLIPSegTextConfig,
						    CLIPSegVisionConfig,
						)
						from .processing_clipseg import CLIPSegProcessor

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_clipseg import (
												    CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST,
												    CLIPSegForImageSegmentation,
												    CLIPSegModel,
												    CLIPSegPreTrainedModel,
												    CLIPSegTextModel,
												    CLIPSegVisionModel,
												)

else:
						import sys

						snake_case							:	Optional[int]					      =				_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)




