
from typing import TYPE_CHECKING

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


A         =    {
    """configuration_oneformer""": ["""ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""", """OneFormerConfig"""],
    """processing_oneformer""": ["""OneFormerProcessor"""],
}

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A         =    ["""OneFormerImageProcessor"""]

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A         =    [
		    """ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """OneFormerForUniversalSegmentation""",
		    """OneFormerModel""",
		    """OneFormerPreTrainedModel""",
		]

if TYPE_CHECKING:
		from .configuration_oneformer import ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, OneFormerConfig
		from .processing_oneformer import OneFormerProcessor

		try:
				if not is_vision_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .image_processing_oneformer import OneFormerImageProcessor
		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_oneformer import (
				    ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    OneFormerForUniversalSegmentation,
				    OneFormerModel,
				    OneFormerPreTrainedModel,
				)


else:
		import sys

		A         =    _LazyModule(__name__, globals()['''__file__'''], _import_structure)

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

from ..features import Features


A		:   Optional[int]         =    TypeVar('''T''', bound='''TaskTemplate''')



@dataclass(frozen=_a						)
class       a_   ( abc.ABC						):
			# `task` is not a ClassVar since we want it to be part of the `asdict` output for JSON serialization
			a  : str
			a  : ClassVar[Features]
			a  : ClassVar[Features]






			def       UpperCamelCase_							(			self							, __UpperCamelCase     ):
									return copy.deepcopy(self     )






			@property
			def       UpperCamelCase_							(			self     ):
									return Features(**self.input_schema							, **self.label_schema     )






			@property
			@abc.abstractmethod
			def       UpperCamelCase_							(			self     ):
									raise NotImplementedError






			@classmethod
			def       UpperCamelCase_							(			cls							, __UpperCamelCase     ):
									_lowercase									=				{f.name for f in dataclasses.fields(cls     )}
									return cls(**{k: v for k, v in template_dict.items() if k in field_names}     )