import dataclasses as dc
from pathlib import Path
from typing import NotRequired, TypeAlias, TypedDict

import numpy as np
import numpy.typing as npt

Box: TypeAlias = tuple[tuple[float, float], tuple[float, float], float]
CsvData: TypeAlias = list[str | int]


@dc.dataclass(kw_only=True, slots=True)
class InferenceResult:
    img: npt.NDArray[np.uint8]
    anomaly_map_resized: npt.NDArray
    anomaly_score: float
    anomaly_label: bool


class ExportData(TypedDict):
    sensor_sizes: tuple[str, ...]
    left: NotRequired[tuple[str, str]]
    right: NotRequired[tuple[str, str]]


class SensorImages(TypedDict):
    left: npt.NDArray
    right: npt.NDArray


class DetectionModels(TypedDict):
    left: Path
    right: Path
