"""
Evaluation metrics aligned with Ultralytics (mAP, confusion matrix, etc.).
Re-exports from ultralytics.utils.metrics when available.
"""

try:
    from ultralytics.utils.metrics import (
        ConfusionMatrix,
        DetMetrics,
        SegmentMetrics,
        PoseMetrics,
        ClassifyMetrics,
        ap_per_class,
        box_iou,
        mask_iou,
        kpt_iou,
    )
    from ultralytics.utils.metrics import OKS_SIGMA
except ImportError as e:
    raise ImportError(
        "nxva.toolbox.val.metrics requires ultralytics. Add project root to PYTHONPATH or install ultralytics."
    ) from e


__all__ = [
    "ConfusionMatrix",
    "DetMetrics",
    "SegmentMetrics",
    "PoseMetrics",
    "ClassifyMetrics",
    "ap_per_class",
    "box_iou",
    "mask_iou",
    "kpt_iou",
    "OKS_SIGMA",
]
