Spaces:
Runtime error
Runtime error
File size: 1,621 Bytes
2eafbc4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
import logging
from dataclasses import dataclass
from datetime import datetime
from enum import Enum
import numpy as np
FrameTimestamp = datetime
FrameID = int
class UpdateSeverity(Enum):
"""Enumeration for defining different levels of update severity.
Attributes:
DEBUG (int): A debugging severity level.
INFO (int): An informational severity level.
WARNING (int): A warning severity level.
ERROR (int): An error severity level.
"""
DEBUG = logging.DEBUG
INFO = logging.INFO
WARNING = logging.WARNING
ERROR = logging.ERROR
@dataclass(frozen=True)
class StatusUpdate:
"""Represents a status update event in the system.
Attributes:
timestamp (datetime): The timestamp when the status update was created.
severity (UpdateSeverity): The severity level of the update.
event_type (str): A string representing the type of the event.
payload (dict): A dictionary containing data relevant to the update.
context (str): A string providing additional context about the update.
"""
timestamp: datetime
severity: UpdateSeverity
event_type: str
payload: dict
context: str
@dataclass(frozen=True)
class VideoFrame:
"""Represents a single frame of video data.
Attributes:
image (np.ndarray): The image data of the frame as a NumPy array.
frame_id (FrameID): A unique identifier for the frame.
frame_timestamp (FrameTimestamp): The timestamp when the frame was captured.
"""
image: np.ndarray
frame_id: FrameID
frame_timestamp: FrameTimestamp
|