def image_and_pixel_evaluator() -> Evaluator:
    """Create an evaluator with image- and pixel-level metrics for testing."""
    image_metric = DummyMetric(fields=["pred_score", "gt_label"], prefix="image_")
    pixel_metric = DummyMetric(fields=["anomaly_map", "gt_mask"], prefix="pixel_", strict=False)
    val_metrics = [image_metric, pixel_metric]
    test_metrics = copy.deepcopy(val_metrics)
    return Evaluator(val_metrics=[image_metric, pixel_metric], test_metrics=test_metrics)
Create an evaluator with image- and pixel-level metrics for testing.
tests/integration/test_task_types.py