Source code for sign_language_translator.vision.sign.transformations

"""
sign.transformations.py
=======================

This module contains the base class for all sign transformations available for data augmentation.
"""

__all__ = [
    "BaseSignTransformation",
]

from abc import ABC, abstractmethod


[docs] class BaseSignTransformation(ABC): """Base class for sign transformations"""
[docs] @staticmethod @abstractmethod def name() -> str: """The string name of the transformation"""
[docs] @abstractmethod def transform(self, sign, *args, **kwargs): """Apply the transformation to a sign"""
def __call__(self, sign, *args, **kwargs): return self.transform(sign, *args, **kwargs)