Skip to main content
SDK Version: 2.5.0

Model Evaluation

This guide provides a comprehensive overview of model evaluation in DX-ModelZoo, covering evaluation workflows, options, and advanced usage patterns.

Prerequisites

Before evaluating models, make sure you have installed DX-ModelZoo and reviewed the Quick Start guide.

Running an Evaluation​

Basic Usage​

The minimal command requires only a model name and profile:

dxmz eval <model_name> --profile <profile> --seed 42

Evaluation Options​

--data-root/--model-root override the DATA_ROOT/MODEL_ROOT environment variables, --model-path points directly at a model file, and --seed makes evaluation reproducible. See CLI Reference for the full option list.

--save writes result/eval_<model>_<profile>.json.

Multiple models can be evaluated in one command:

# Evaluate multiple models sequentially
dxmz eval resnet50_224x224 mobilenetv2_224x224 --profile onnx --seed 42
# Results are saved separately for each model when --save is used

Evaluation Flow​

The following sequence diagram shows the internal call flow:

Sync vs Async Evaluation​

The evaluator automatically selects the mode based on the session's async support:

for batch in dataloader:
output = session.run(input) # Synchronous inference
postprocessing(output)
update_metrics()
  • Default mode
  • Used with ONNX Runtime

Batch Size​

ONNX profiles support adjustable batch_size:

resnet50_224x224.yaml
profiles:
onnx:
target: onnx
runtime:
device: gpu
batch_size: 4 # Batch size 4
dxnn Profiles

Profiles with target: dxnn are always forced to batch_size=1. Any other value set in the YAML is ignored.

Evaluation Output​

Result Format​

Evaluation results are structured as follows:

{
"model": "resnet50_224x224",
"dataset": "imagenet",
"metrics": [
{"name": "Top-1", "metric_value": 69.76},
{"name": "Top-5", "metric_value": 89.08}
],
"fps": 624.7,
"elapsed_time": 82,
"start_time": "2026-07-23 14:30:00",
"profile": "onnx"
}
FPS Calculation

FPS is reported differently for the sync and async evaluation paths, so the two numbers are not directly comparable.

PathFormulaIncludedExcluded
Sync (default)images / inference_timeInference only (run_inference, incl. model input extraction)Data loading, pre/postprocessing
Async (session use_async)images / wall_timeEverything: loader wait, inference, postprocessing—

The sync path measures the inference section per batch; the async path uses total wall time of the pipeline. Use the Time Breakdown below to see how much load / infer / post each contributes.

Time Breakdown​

A time breakdown is automatically printed after evaluation:

Time breakdown — load: 12.3s (15%) | infer: 65.2s (79%) | post: 4.8s (6%)
PhaseDescription
loadData loading + preprocessing time
inferModel inference time
postPostprocessing + metric update time

Built-in Evaluators​

Common evaluators include the following (see the Evaluator API for the complete list of all built-in evaluators):

EvaluatorTaskMetrics
image_classificationClassificationTop-1, Top-5 Accuracy
object_detectionDetection (COCO/VOC)mAP@0.5, mAP@0.5:0.95
semantic_segmentationSegmentationmIoU
depth_estimationDepthδ < 1.25, RMSE
pose_estimationPoseAP, AR
face_landmarkLandmarkNME
face_recognitionFace verificationAccuracy
super_resolutionSuper resolutionPSNR
oriented_object_detectionOriented detectionmAP
zero_shot_image_classificationZero-shotTop-1 Accuracy
image_retrievalImage RetrievalTop-1, Top-5 Accuracy