class ColorSpace(StrEnum): OTHER = StrEnum.auto() GRAY = StrEnum.auto() GRAY_ALPHA = StrEnum.auto() RGB = StrEnum.auto() RGB_ALPHA = StrEnum.auto() @classmethod def from_pil_mode(cls, mode: str) -> ColorSpace: if mode == "L": return cls.GRAY elif mode == "LA": return cls.GRAY_ALPHA elif mode == "RGB": return cls.RGB elif mode == "RGBA": return cls.RGB_ALPHA else: return cls.OTHER
class BoundingBoxFormat(StrEnum): XYXY = StrEnum.auto() XYWH = StrEnum.auto() CXCYWH = StrEnum.auto()
class ColorSpace(StrEnum): OTHER = StrEnum.auto() GRAYSCALE = StrEnum.auto() RGB = StrEnum.auto()