






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
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


lowercase  							= logging.get_logger(__name__)

lowercase  							= {
    "facebook/convnext-tiny-224": "https://huggingface.co/facebook/convnext-tiny-224/resolve/main/config.json",
    # See all ConvNeXT models at https://huggingface.co/models?filter=convnext
}




class 			UpperCamelCase_				(      snake_case_	, snake_case_    ):



	'''simple docstring'''




	lowerCAmelCase													=			'''convnext'''




	def __init__(	self	,      a=3	,      a=4	,      a=4	,      a=None	,      a=None	,      a="gelu"	,      a=0.02	,      a=1E-12	,      a=1E-6	,      a=0.0	,      a=2_24	,      a=None	,      a=None	,      **a	,      )	->   Any:
								super().__init__(**a )

								snake_case_           =							num_channels
								snake_case_           =							patch_size
								snake_case_           =							num_stages
								snake_case_           =							[96, 1_92, 3_84, 7_68] if hidden_sizes is None else hidden_sizes
								snake_case_           =							[3, 3, 9, 3] if depths is None else depths
								snake_case_           =							hidden_act
								snake_case_           =							initializer_range
								snake_case_           =							layer_norm_eps
								snake_case_           =							layer_scale_init_value
								snake_case_           =							drop_path_rate
								snake_case_           =							image_size
								snake_case_           =							['stem'] + [F'''stage{idx}''' for idx in range(1	,      len(self.depths ) + 1 )]
								snake_case_      ,		snake_case_           =							get_aligned_output_features_output_indices(
								    out_features=a	,      out_indices=a	,      stage_names=self.stage_names )






class 			UpperCamelCase_				(      snake_case_    ):



	'''simple docstring'''




	lowerCAmelCase													=			version.parse('''1.11'''    )




	@property
	def 							_UpperCamelCase      (	self )	->   Mapping[str, Mapping[int, str]]:
								return OrderedDict(
								    [
								        ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
								    ] )






	@property
	def 							_UpperCamelCase      (	self )	->   float:
								return 1E-5













from typing import TYPE_CHECKING

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


lowercase  							= {
    "configuration_deformable_detr": ["DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP", "DeformableDetrConfig"],
}

try:
	if not is_vision_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	lowercase  							= ["DeformableDetrFeatureExtractor"]
	lowercase  							= ["DeformableDetrImageProcessor"]

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	lowercase  							= [
	    "DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST",
	    "DeformableDetrForObjectDetection",
	    "DeformableDetrModel",
	    "DeformableDetrPreTrainedModel",
	]


if TYPE_CHECKING:
	from .configuration_deformable_detr import DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, DeformableDetrConfig

	try:
		if not is_vision_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .feature_extraction_deformable_detr import DeformableDetrFeatureExtractor
		from .image_processing_deformable_detr import DeformableDetrImageProcessor

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_deformable_detr import (
		    DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST,
		    DeformableDetrForObjectDetection,
		    DeformableDetrModel,
		    DeformableDetrPreTrainedModel,
		)

else:
	import sys

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





