from .val_speed import SpeedCalculator, Profile
from .dataloader import DatasetLoader

# Evaluation metrics and validators (lazy / conditional to avoid circular deps)
def __getattr__(name):
    if name == "ConfusionMatrix" or name == "ap_per_class" or name == "box_iou" or name == "mask_iou" or name == "kpt_iou":
        from .metrics import ConfusionMatrix, ap_per_class, box_iou, mask_iou, kpt_iou
        d = {"ConfusionMatrix": ConfusionMatrix, "ap_per_class": ap_per_class, "box_iou": box_iou, "mask_iou": mask_iou, "kpt_iou": kpt_iou}
        return d.get(name)
    if name == "DetectionValidator":
        from .val_detection import DetectionValidator
        return DetectionValidator
    if name == "SegmentValidator":
        from .val_segment import SegmentValidator
        return SegmentValidator
    if name == "PoseValidator":
        from .val_pose import PoseValidator
        return PoseValidator
    if name == "ClassifyValidator":
        from .val_classify import ClassifyValidator
        return ClassifyValidator
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

from .run import run_evaluation

__all__ = [
    "run_evaluation",
    "SpeedCalculator",
    "Profile",
    "DatasetLoader",
    "ConfusionMatrix",
    "ap_per_class",
    "box_iou",
    "mask_iou",
    "kpt_iou",
    "DetectionValidator",
    "SegmentValidator",
    "PoseValidator",
    "ClassifyValidator",
]
