본문으로 건너뛰기
SDK Version: 2.5.0

Architecture Overview

The DX-ModelZoo architecture is designed around a YAML-centric configuration approach, where ModelBuilder and the Registry pattern connect all components for runtime execution.

Architecture Diagram​

The following diagram shows how components connect at runtime:

ModelBuilder connects the CLI, Registry, and Runtime layers shown above.

Core Design Principles​

YAML-Centric​

Every model definition is fully self-contained within a YAML file. Preprocessing, postprocessing, datasets, and profiles are configured declaratively without writing any Python code.

# A model is fully defined by this alone
name: resnet50_224x224
preprocessing: [...]
postprocessing: [...]
evaluator: { type: image_classification }
dataset: { type: ILSVRC2012, eval_path: ... }
profiles: { onnx: ..., q-lite: ... }

Registry Pattern Everywhere​

Four registries manage all extensible components:

RegistryRoleExamples
PREPROCESSING_REGISTRYPreprocessing operationsresize, normalize, div
POSTPROCESSING_REGISTRYPostprocessing operationstopk, nms, identity
DATASET_REGISTRYDataset loadersILSVRC2012, COCO, PascalVOC2007
EVALUATOR_REGISTRYEvaluation logicimage_classification, object_detection

Postprocessing vs. Evaluator​

DX-ModelZoo strictly separates output decoding from metric computation:

ComponentRole
Postprocessing (custom_ops.py or shared postprocessing/)Transforms raw model tensors into a standardized, task-specific format
EvaluatorConsumes the standardized output and computes quality metrics (mAP, accuracy, AUROC, etc.)

Builder Pattern​

ModelBuilder is responsible for transforming YAML into runtime components:

Source Directory Structure​

The corresponding source code is organized as follows:

src/dx_modelzoo/
├── main.py # CLI entry point (Typer)
├── command/
│ ├── compile.py # NPU compilation logic
│ ├── benchmark.py # Multi-model batch evaluation
│ └── create_yaml.py # Interactive YAML creation
├── common/
│ ├── dataloader.py # Pure numpy DataLoader
│ ├── enums.py # DeviceType, EvaluationType, DatasetType
│ ├── registry.py # Registry pattern
│ ├── seed.py # Global seed management
│ └── ...
├── preprocessing/ # Registered preprocessing ops + pipeline
├── postprocessing/ # Shared ops + decode utilities
├── evaluator/ # Task evaluators
├── dataset/ # Registered dataset classes
├── loader/
│ ├── yaml_loader.py # YAML parse + validation
│ ├── model_builder.py # Build all runtime objects from YAML
│ ├── model_scaffold.py# YAML creation scaffolding
│ └── discovery.py # Model directory scanning
├── session/
│ ├── onnx_session.py # ONNX Runtime backend
│ ├── dx_session.py # DxRuntime (NPU) backend
│ ├── runtime_config.py# RuntimeConfig dataclasses
│ └── factory.py # Session creation + auto-download
├── models/ # 300+ YAML model configs
└── tui/ # Interactive model browser + wizard

Data Flow​

The data flow through the full evaluation process:

StageComponentData Format
LoadDatasetBGR np.ndarray (H, W, 3)
PreprocessingPreprocessingPipelinefloat32 np.ndarray (1, C, H, W)
InferenceSessionlist[np.ndarray] (raw model outputs)
PostprocessingPostprocessingPipeline + custom_opsTask-specific standardized format
EvaluationEvaluatormetrics dict
NPU Mode

When using a target: dxnn profile, arithmetic preprocessing operations (div, normalize, transpose, etc.) are automatically skipped. This is because the NPU handles these operations at the hardware level.