
"""simple docstring"""




from typing import TYPE_CHECKING

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


snake_case			       =		{
    'configuration_deformable_detr': ['DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DeformableDetrConfig'],
}

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

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	snake_case			       =		[
	    '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

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


"""simple docstring"""




import abc
import copy
import dataclasses
from dataclasses import dataclass
from typing import ClassVar, Dict, Type, TypeVar

from ..features import Features


snake_case			       =		TypeVar('T', bound='TaskTemplate')




@dataclass(frozen=__magic_name__				)
class 					UpperCamelCase     (	abc.ABC				):

				"""simple docstring"""



				UpperCAmelCase_    :				str
				UpperCAmelCase_    :				ClassVar[Features]
				UpperCAmelCase_    :				ClassVar[Features]


				def 							A (    self		,     lowercase__      )   ->   T:
									"""simple docstring"""







									return copy.deepcopy(self      )


				@property
				def 							A (    self      )   ->   Features:
									"""simple docstring"""







									return Features(**self.input_schema		,     **self.label_schema      )


				@property
				@abc.abstractmethod
				def 							A (    self      )   ->   Dict[str, str]:
									"""simple docstring"""







									raise NotImplementedError




				@classmethod
				def 							A (    cls		,     lowercase__      )   ->   T:
									"""simple docstring"""







									SCREAMING_SNAKE_CASE           =     {f.name for f in dataclasses.fields(cls      )}
									return cls(**{k: v for k, v in template_dict.items() if k in field_names}      )
