Skip to contents

yolo_model_details() (and its alias yolo_details()) inspects a YOLO model in PyTorch (.pt) or ONNX (.onnx) format and extracts extensive structural, architectural, and training metadata.

It extracts:

  • Format & Provenance: Model format (.pt or .onnx), file size, SHA-256 and MD5 cryptographic hashes, Ultralytics version, export/training date, author, description, license, and documentation URL.

  • Model Specifications: Computer vision task ("detect", "segment", "pose", "classify", or "obb"), architecture definition, total parameter count, feature map strides, default input image resolution (imgsz), batch size, and input channels.

  • I/O Tensor Signatures (ONNX): Input and output tensor names, full multidimensional shape signatures, and tensor data types.

  • Classes: Total number of classes and complete class label taxonomy.

  • Training Configuration (PyTorch checkpoints): Epochs trained, best fitness score, optimizer, learning rates, data source, and hyperparameters.

  • Export Settings (ONNX): Target opset, half-precision (FP16), dynamic axes, ONNX simplification, and non-maximum suppression (NMS) flags.

Usage

yolo_model_details(model, verbose = TRUE, ...)

yolo_details(model, verbose = TRUE, ...)

Arguments

model

A character string specifying the path to a .pt or .onnx model file, or the name of a built-in pre-trained model (e.g. "yolo11n", "yolo26n-seg").

verbose

Logical. If TRUE (default), prints a formatted diagnostic overview to the R console.

...

Currently unused.

Value

An invisible object of class c("yolo_model_details", "list") containing:

  • file: Absolute path to the inspected model file.

  • file_name: File basename.

  • format: Model file format ("PyTorch (.pt)" or "ONNX (.onnx)").

  • file_size: Human-readable file size string (e.g. "5.35 MB").

  • file_size_bytes: Raw file size in bytes.

  • sha256: SHA-256 checksum string.

  • md5: MD5 checksum string.

  • task: Model task ("detect", "segment", "pose", "classify", "obb").

  • architecture: Network architecture or YAML scale descriptor if available.

  • num_classes: Total number of recognized object categories.

  • classes: Character vector of class names.

  • parameters: Total number of model weights/parameters (numeric).

  • parameters_formatted: Human-readable parameter count (e.g. "2.62 M").

  • stride: Feature map stride value or vector (e.g. c(8, 16, 32)).

  • imgsz: Default/training image resolution (e.g. c(640, 640)).

  • batch: Default batch size.

  • channels: Number of input color channels (typically 3 for RGB).

  • inputs: data.frame detailing input tensor names, shapes, and types.

  • outputs: data.frame detailing output tensor names, shapes, and types.

  • version: Ultralytics version used during training or export.

  • date: Creation/training timestamp.

  • author: Model author or organization.

  • description: Model description or training dataset reference.

  • license: Model license string.

  • docs: Documentation URL.

  • export_args: List of ONNX exporter configuration settings.

  • train_args: List of training hyperparameters and arguments (if present).

  • epoch: Number of completed training epochs.

  • best_fitness: Best validation fitness metric achieved during training.

Examples

if (FALSE) { # \dontrun{
  library(pliman)

  # Inspect a pre-trained ONNX model
  details <- yolo_model_details("yolo11n")

  # Inspect a custom trained PyTorch checkpoint
  pt_details <- yolo_model_details("runs/detect/train/weights/best.pt")

  # Access specific metadata fields
  pt_details$task
  pt_details$num_classes
  pt_details$classes
  pt_details$parameters
  pt_details$sha256
} # }