跳转到主要内容
SDK Version: 2.5.0

CLI Reference

DX-ModelZoo performs all operations through the dxmz CLI tool. It is built on Typer.

Installation Verification​

Confirm the CLI is installed and accessible:

dxmz --help

Command Overview​

DX-ModelZoo provides the following commands:

CommandDescription
evalModel evaluation
compileNPU compilation
benchmarkMulti-model benchmarking
listList available models
infoModel details
createCreate a new model YAML interactively

dxmz eval​

Evaluates one or more models on their datasets and outputs metrics.

dxmz eval <model> [<model2> ...] --profile <profile> [options]

Arguments​

ArgumentDescriptionExample
modelOne or more model names or YAML pathsresnet50_224x224, ./my_model.yaml

Options​

OptionDescriptionDefault
--profileRuntime profile(required)
--data-rootDataset root directory (overrides DATA_ROOT)Environment variable
--model-rootModel file root directory (overrides MODEL_ROOT)Environment variable
--model-pathExplicit path to the model fileNone (falls back to artifacts.path in YAML)
--saveSave results as JSONFalse
--seedRandom seed for reproducible evaluation42

Examples​

# Basic evaluation
dxmz eval resnet50_224x224 --profile onnx

# Multiple models
dxmz eval resnet50_224x224 mobilenetv3-large_224x224 --profile onnx

# Specify data/model paths
dxmz eval resnet50_224x224 --profile onnx \
--data-root /data/datasets \
--model-root /data/models

# Explicit model file path + save results
dxmz eval resnet50_224x224 --profile q-lite \
--model-path /path/to/resnet50.dxnn \
--save

# Pipeline model with stage-specific model paths
dxmz eval ocr_pipeline.yaml --profile onnx \
--model-path "det=/path/det.onnx,rec=/path/rec.onnx"

dxmz compile​

Compiles a model for the NPU.

dxmz compile <model> --profile <profile> [options]

Arguments​

ArgumentDescriptionExample
modelModel name or YAML pathyolov8-n_640x640

Options​

OptionDescriptionDefault
--profileCompilation profile (c-lite, q-lite, q-pro)(required)
--outputOutput directory or file pathAuto-generated
--model-pathSource ONNX model pathNone (falls back to artifacts.path in YAML)
--data-rootCalibration data pathEnvironment variable
--model-rootModel file rootEnvironment variable

Examples​

# Basic compilation
dxmz compile resnet50_224x224 --profile q-lite

# Specify output directory
dxmz compile resnet50_224x224 --profile q-pro --output ./compiled/

# NPU compilation with q-lite calibration
dxmz compile yolov8-n_640x640 --profile q-lite

# Pipeline model with stage paths
dxmz compile ocr_pipeline.yaml --profile q-lite \
--model-path "det=/path/det.onnx,rec=/path/rec.onnx"

dxmz benchmark​

Benchmarks multiple models in batch with optional parallel execution.

dxmz benchmark --profile <profile> [options]

Options​

OptionDescriptionDefault
--profileRuntime profile(required)
--models-dirDirectory containing model YAMLsBuiltin models
--data-rootDataset rootEnvironment variable
--model-rootModel file rootEnvironment variable
--domainDomain filter (e.g., cv)All
--taskTask filter (e.g., image_classification)All
--devicesComma-separated device IDs for parallel executionNone (sequential execution)
--saveSave results to JSON fileFalse

Examples​

# Benchmark all models
dxmz benchmark --profile onnx

# Benchmark specific task
dxmz benchmark --profile onnx --task image_classification

# Parallel on multiple NPU devices
dxmz benchmark --profile q-lite --devices 0,1,2,3

# Save results
dxmz benchmark --profile q-lite --save

Saved output uses result/benchmark_<profile>_<timestamp>.json.

dxmz list​

Displays the list of available models. By default, an interactive tree browser is launched.

dxmz list [options]

Options​

OptionDescriptionDefault
--domainDomain filterAll
--taskTask filterAll
--all, -aOutput as plain text instead of the interactive UIFalse

Examples​

# Interactive model browser
dxmz list

# Full list in plain text
dxmz list --all

# Filter by specific task
dxmz list -a --task object_detection
Interactive Browser

Running dxmz list without any options launches a TUI (Text User Interface) tree browser. Use the arrow keys to navigate and press Enter to view model details.

dxmz info​

Displays detailed information about a specific model.

dxmz info <model>

Arguments​

ArgumentDescriptionExample
modelModel name or YAML pathresnet50_224x224

Examples​

dxmz info resnet50_224x224

Sample output:

Name: resnet50_224x224
Inputs: [{'name': 'input', 'shape': [1, 3, 224, 224], 'dtype': 'float32'}]
Profiles: ['onnx', 'c-lite', 'q-lite', 'q-pro']
Dataset: {'type': 'ILSVRC2012', 'eval_path': '${DATA_ROOT}/ILSVRC2012/val'}

dxmz create​

Interactively create a new model YAML configuration file.

dxmz create

Launches a step-by-step wizard that asks for model name, task, input shape, preprocessing, and generates the YAML file.

Environment Variables​

Key environment variables used by the CLI:

VariableDescriptionCLI Override
DATA_ROOTDataset root directory--data-root
MODEL_ROOTModel file root directory--model-root
DXMZ_MODEL_URLModel auto-download base URLNone
DXNN_DEVICESDxRuntime device specificationNone
Environment Variable Precedence

When CLI options (--data-root, --model-root) are specified, they take precedence over environment variables.

Profile Types​

The following runtime profiles are available across commands:

ProfileTargetDescription
onnxONNX RuntimeCPU/GPU inference
c-litedxnnCompile-Lite (opt_level=0, minimal optimization)
q-litedxnnQuantize-Lite (EMA calibration)
q-prodxnnDXNN profile with calibration.use_q_pro: true