
Setup Complete ONNX Deep Learning Environment and Pre-trained Models
Source:R/utils_neural.R
onnx_setup.RdSets up the entire zero-Python, zero-external-package Deep Learning environment in a single call with interactive CLI feedback.
Usage
onnx_setup(
models = c("u2netp", "yolo26s", "dinov2"),
dir = pliman_model_dir(),
force = FALSE,
engine = c("auto", "gpu", "cpu"),
test = TRUE,
verbose = TRUE
)
pliman_configure_dl(
models = c("u2netp", "yolo26s", "dinov2"),
dir = pliman_model_dir(),
force = FALSE,
engine = c("auto", "gpu", "cpu"),
test = TRUE,
verbose = TRUE
)
pliman_setup_onnx(
models = c("u2netp", "yolo26s", "dinov2"),
dir = pliman_model_dir(),
force = FALSE,
engine = c("auto", "gpu", "cpu"),
test = TRUE,
verbose = TRUE
)
setup_onnx(
models = c("u2netp", "yolo26s", "dinov2"),
dir = pliman_model_dir(),
force = FALSE,
engine = c("auto", "gpu", "cpu"),
test = TRUE,
verbose = TRUE
)Arguments
- models
Character vector of models to pre-download. Defaults to
c("u2netp", "yolo26s", "dinov2"). You can also specify"all"to download all standard models, orNULLto only configure the runtime engine.- dir
Directory to store models (default:
pliman_model_dir()).- force
Logical. Force re-download and re-configuration even if already present (default
FALSE).- engine
Execution engine:
"auto"(default),"gpu", or"cpu". When"auto", automatically detects compatible GPU hardware and configures GPU acceleration.- test
Logical. If
TRUE(default), runs quick native C++ self-test inferences to ensure all downloaded models are operational.- verbose
Logical. Whether to print formatted CLI messages (default
TRUE).
Details
This function:
Inspects graphics hardware (DirectX 12 / DirectML GPU and CUDA adapters) and displays adapter names and VRAM.
Downloads and verifies official Microsoft ONNX Runtime C++ shared libraries (DirectML GPU binaries on Windows, and CPU binaries across all operating systems).
Pre-downloads the essential foundation models (
"u2netp"for salient segmentation,"yolo26s"for object detection, and"dinov2"for vision foundation embeddings).Runs native C++ self-test inference on all installed models to confirm 100% operational status.
Provides immediate, copy-paste ready examples to run
image_detect_dl(),image_segment_dl(), andimage_remove_bg().