

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

from ..features import Features


_UpperCAmelCase    	=			TypeVar("T", bound="TaskTemplate")



@dataclass(frozen=__lowercase			)
class        _UpperCAmelCase (   abc.ABC			):
  '''simple docstring'''







  SCREAMING_SNAKE_CASE							:				str
  SCREAMING_SNAKE_CASE							:				ClassVar[Features]
  SCREAMING_SNAKE_CASE							:				ClassVar[Features]







  def 	UpperCamelCase       ( self	: T		,						UpperCamelCase__	: Features ):
        return copy.deepcopy(self )







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







  @property
  @abc.abstractmethod
  def 	UpperCamelCase       ( self	: List[Any] ):
        raise NotImplementedError







  @classmethod
  def 	UpperCamelCase       ( cls	: Type[T]		,						UpperCamelCase__	: dict ):
        A    =				{f.name for f in dataclasses.fields(cls )}
        return cls(**{k: v for k, v in template_dict.items() if k in field_names} )






from ..utils import requires_backends


_UpperCAmelCase    	=			None



class        _UpperCAmelCase :
  '''simple docstring'''







  def __init__( self	: List[str]		,						*UpperCamelCase__	: str		,						**UpperCamelCase__	: Any ):
        requires_backends(self		,						['detectron2'] )







  @classmethod
  def 	UpperCamelCase       ( cls	: Dict		,						*UpperCamelCase__	: Tuple		,						**UpperCamelCase__	: List[Any] ):
        requires_backends(cls		,						['detectron2'] )



