"""Auto-generated stub for module: detection."""
from typing import Any

# Functions
def box_iou(boxes1: Any.Any, boxes2: Any.Any) -> Any.Any:
    """
    Compute IoU matrix for `xyxy` boxes with shapes [N, 4] and [M, 4].
    """
    ...
def compute_map_metrics(outputs: Any[Any[str, Any]], targets: Any[Any[str, Any]], num_classes: int, iou_thresholds: Any[float] = (0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95), background_class: int | None = 0) -> tuple[float, float, dict[int, float]]:
    """
    Compute mAP@50, mAP@50-95 and per-class AP@50.
    """
    ...
def compute_metrics(outputs: Any[Any[str, Any]], targets: Any[Any[str, Any]], num_classes: int, iou_threshold: float = 0.5, background_class: int | None = 0) -> tuple[Any.Any, Any.Any, Any.Any]:
    """
    Compute per-class precision, recall and F1-score for detection outputs.
    """
    ...
def epoch_metrics(data_loader: Any[tuple[Any[Any.Any], Any[Any[str, Any]]]], model: Any.Any.Any, device: Any.Any, num_classes: int, iou_threshold: float = 0.5, background_class: int | None = 0) -> Any[str, float]:
    """
    Run model inference for one epoch and aggregate detection metrics.
    """
    ...
