
Inspect Detailed Metadata and Specifications of YOLO Models
Source:R/utils_yolo_details.R
yolo_model_details.Rdyolo_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 (
.ptor.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.
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 (typically3for RGB).inputs:data.framedetailing input tensor names, shapes, and types.outputs:data.framedetailing 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
} # }