Installation
Step-by-step instructions for installing DX-ModelZoo and its dependencies on Linux systems.
Prerequisites
Before installing DX-ModelZoo, ensure you have the following:
- Python: 3.8+
- DeepX Components:
- DeepX Runtime (DX-RT) ≥ 3.5.0 (compiled with
USE_ORT=ON) - DeepX Compiler (DX-Compiler) ≥ 2.5.0
- DeepX Runtime (DX-RT) ≥ 3.5.0 (compiled with
DX-ModelZoo runs on Windows via WSL2 (Windows Subsystem for Linux).
To install WSL2:
# Run in PowerShell (admin mode)
wsl --install
Then reboot and launch Ubuntu from the Start menu. See Microsoft's WSL documentation for details.
For GPU inference:
- NVIDIA GPU (Pascal/Turing/Ampere architecture)
- NVIDIA Driver ≥ 535.230.02
- CUDA 12.2
- cuDNN 9.1
Installation Overview
Required Steps
- Step 1. Install DeepX Components - DX-RT & DX-Compiler
- Step 2. Clone Repository - Get the source code
- Step 3. Basic Installation - CPU or GPU inference setup
Optional Steps (choose as needed)
- Optional 1. GPU Inference - For CUDA acceleration
- Optional 2. Development Environment - For contributors
- Optional 3. Documentation Build - To build docs locally
- Optional 4. Full Installation - All features at once
Required Installation
Step 1: Install DeepX Components
# Install DX-RT python package
pip install dx_engine-*.whl
# Install DX-Compiler python package
pip install dx_com-*.whl
Refer to the official DX-RT and DX-Compiler installation guides for detailed setup instructions.
Step 2: Clone Repository
git clone https://github.com/DEEPX-AI/dx-modelzoo.git
cd dx-modelzoo
Step 3: Basic Installation — choose CPU or GPU
Pick exactly one ONNX Runtime backend. onnxruntime and onnxruntime-gpu must
not be installed in the same environment (ONNX Runtime install guide).
# CPU inference
pip install -e ".[cpu]"
# GPU inference (CUDA) — see the CUDA note under Optional Installation
pip install -e ".[gpu]"
This installs the selected ONNX Runtime build and all core dependencies.
Remove the other distribution before switching, otherwise both remain installed and provider resolution becomes undefined:
# CPU -> GPU
pip uninstall -y onnxruntime && pip install -e ".[gpu]"
# GPU -> CPU
pip uninstall -y onnxruntime-gpu && pip install -e ".[cpu]"
Verify with pip list | grep onnxruntime — exactly one entry should remain.
Optional Installation
Optional 1: GPU Inference (CUDA) environment setup
See GPU Requirements above for driver/CUDA/cuDNN versions.
After installing .[gpu], add NVIDIA library paths to LD_LIBRARY_PATH:
# Add to ~/.zshrc or ~/.bashrc
export LD_LIBRARY_PATH=$(python -c "import nvidia.cublas.lib; print(nvidia.cublas.lib.__path__[0])"):$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$(python -c "import nvidia.cudnn.lib; print(nvidia.cudnn.lib.__path__[0])"):$LD_LIBRARY_PATH
Optional 2: Development Environment
pip install -e ".[dev]" # Includes pytest, ruff
Optional 3: Documentation Build
Documentation build requires Python 3.9 or newer because the configured PDF plugin does not support Python 3.8.
pip install -e ".[docs]"
mkdocs serve -f docs/mkdocs.yml # Preview at http://localhost:8000
Build a static site and PDF from repository root:
mkdocs build -f docs/mkdocs.yml
The docs extra includes MkDocs, Material, mkdocstrings, the include-markdown
plugin, and the PDF plugin configured in docs/mkdocs.yml.
Optional 4: Full Installation (cpu + dev + docs)
pip install -e ".[all]"
This installs every optional extra at once.
Core Dependencies
DX-ModelZoo keeps its core dependencies minimal:
pyyaml>=5.0
numpy>=1.20,<3.0
Pillow>=8.0
opencv-python>=4.5
python-dotenv>=0.19
tqdm>=4.60
loguru>=0.6
typer>=0.9
rich>=12.0
textual>=0.40
h5py
scipy
faster-coco-eval
open_clip_torch
transformers
pyclipper>=1.3.0.post6
shapely>=2.0.7
torch is a core dependency in pyproject.toml, and the source tree also
relies on torchvision APIs for preprocessing/data loading paths. Do not
treat PyTorch as an optional compile-only add-on.
Extras Summary
| Extra | Packages | Purpose |
|---|---|---|
cpu | onnxruntime>=1.15 | CPU-based ONNX inference |
gpu | onnxruntime-gpu>=1.17 | GPU-based ONNX inference |
dev | pytest>=7.0, ruff>=0.1 | Testing & linting |
docs | mkdocs, mkdocs-material, mkdocstrings, mkdocs-include-markdown-plugin, mkdocs-to-pdf | Documentation build |
all | cpu + dev + docs | Everything |
Alternative Package Manager
Using uv
For faster dependency resolution, you can use uv instead of pip:
uv pip install -e ".[cpu]"
uvpip install uv # Install uv
uv pip install -e ".[gpu]" # Fast installation