Skip to contents

Sets 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, or NULL to 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).

Value

A list containing engine, gpu_info, has_gpu, installed_models, and test_status invisibly.

Details

This function:

  1. Inspects graphics hardware (DirectX 12 / DirectML GPU and CUDA adapters) and displays adapter names and VRAM.

  2. Downloads and verifies official Microsoft ONNX Runtime C++ shared libraries (DirectML GPU binaries on Windows, and CPU binaries across all operating systems).

  3. Pre-downloads the essential foundation models ("u2netp" for salient segmentation, "yolo26s" for object detection, and "dinov2" for vision foundation embeddings).

  4. Runs native C++ self-test inference on all installed models to confirm 100% operational status.

  5. Provides immediate, copy-paste ready examples to run image_detect_dl(), image_segment_dl(), and image_remove_bg().

Examples

if (FALSE) { # interactive()
  onnx_setup()
  onnx_setup(engine = "cpu")
}