Skip to content

ultralytics

YOLO detection settings.

Full parameter reference: https://github.com/ultralytics/ultralytics

Generated from geotrax/cfg/default.yaml; every row below is a key of that file with its shipped default and its inline comment.

Key Default CLI Description
task detect (str) YOLO task; i.e. detect, segment, semantic, depth, classify, pose, obb
mode track (str) YOLO mode; i.e. train, val, predict, export, track, benchmark

Model — set in the 'extraction:' section above (extraction -> model); accepts a local path or an hf:// reference — CLI: --model

Key Default CLI Description
data null (str, optional) path to dataset file (e.g. coco8.yaml) or classification directory/name
imgsz 1920 (int | list) inference image size (square int, or [h,w])
device null (int | str | list) detection compute device; blank = auto (CUDA/GPU when available, else CPU); 0/[0,1,2,3] for CUDA, 'npu:0' Ascend, 'xpu:0' Intel, 'cpu'/'mps', or -1/[-1,-1] to auto-select idle GPUs

Detection / inference

Key Default CLI Description
conf 0.25 --conf (float) object confidence threshold for detection; [0.0, 1.0]
iou 0.7 (float) IoU threshold for NMS; [0.0, 1.0]
max_det 1000 (int) maximum number of detections per image; [1, inf)
classes [0,1,2,3] --classes (int | list[int]) filter by class id(s); 0=car, 1=bus, 2=truck, 3=motorcycle
augment false (bool) apply test-time augmentation during prediction
agnostic_nms true (bool) class-agnostic NMS
dnn false (bool) use OpenCV DNN for ONNX inference
vid_stride 1 (int) read every Nth frame for video sources
stream_buffer false (bool) true buffers all frames; false keeps the most recent frame
visualize false (bool) save class activation heatmaps during prediction
channels_last null (bool, optional) channels-last memory format; null = auto (non-Windows CUDA training on PyTorch 1.11+, supported x86 CPU inference)

Output / display

Key Default CLI Description
show false (bool) show images/videos in a window if supported
save false (bool) save predict results
save_frames false (bool) save individual frames from video predictions
save_txt false (bool) save results as .txt files (xywh format)
save_conf true (bool) save confidence scores with results
save_crop false (bool) save cropped prediction regions to files
show_labels true (bool) draw class labels on images
show_conf true (bool) draw confidence values on images
show_boxes true (bool) draw bounding boxes on images
line_width 2 (int, optional) bounding-box line width; auto-scales if not set
embed null (list[int], optional) return feature embeddings from given layer indices
retina_masks false (bool) use high-resolution segmentation masks (segment only)

Export

Key Default CLI Description
format torchscript (str) export target format; e.g. torchscript|onnx|openvino|engine|coreml|...
optimize false (bool) DEEPX only; higher compiler optimization (slower compile, faster inference)
quantize null --set quantize=16 (int|str, optional) inference and export precision: 8/'int8', 16/'fp16', 32/'fp32', 'w8a8', 'w8a16', 'w8a32', 'w16a16'; null = default (fp32); FP16 applies on GPU only, CPU inference stays FP32. Replaces the removed 'half' key, which ultralytics discards whenever 'quantize' is also present
dynamic false (bool) dynamic shapes for torchscript, onnx, openvino, engine, coreml, mnn
simplify false (bool) ONNX-based exports only; simplify the intermediate ONNX graph
opset null (int, optional) ONNX-based exports only; intermediate ONNX opset version; leave unset for tested default
workspace 4 (float, optional) TensorRT engine only; workspace size in GiB
nms null (bool, optional) null = external NMS (default; the only option for YOLOv8, which has no NMS-free head); true = embed NMS in the exported model; false = NMS-free one-to-one head (YOLO26, YOLOv10)

Val/Test

Key Default CLI Description
val true (bool) run validation/testing during training
split val (str) dataset split to evaluate: 'val', 'test', or 'train'
save_json false (bool) save COCO JSON (detect/segment/pose), compute detect size metrics, or save PNG masks (semantic)
plots true (bool) save plots and images during train/val

Training

Key Default CLI Description
epochs 200 (int) number of epochs to train for
time null (float, optional) max training hours; overrides epochs if set
patience 50 (int) early stop after N epochs without improvement
batch 8 (int | float) batch size as int, -1 for AutoBatch, or a float in (0.0, 1.0) for a GPU memory fraction
save_period -1 (int) save checkpoint every N epochs; disabled if < 1
cache false (bool | str) cache images in RAM ('ram') or on 'disk'; false disables
workers 8 (int) dataloader workers (per RANK if DDP)
project null (str, optional) project name for results root
name null (str, optional) experiment name; results saved in 'project/name'
exist_ok true (bool) overwrite existing 'project/name' if true
pretrained true (bool | str) use pretrained weights (bool) or load from path (str)
cls_remap true (bool) when fine-tuning across datasets, remap pretrained classification head rows by class-name match
optimizer auto (str) optimizer: SGD, MuSGD, Adam, Adamax, AdamW, NAdam, RAdam, RMSProp, or auto
verbose false (bool) print verbose logs during training/val
seed 0 (int) random seed for reproducibility
deterministic true (bool) enable deterministic ops; reproducible but may be slower
single_cls false (bool) treat all classes as a single class
rect false (bool) rectangular batches for train; rectangular batching for val
cos_lr false (bool) cosine learning rate scheduler
close_mosaic 10 (int) disable mosaic augmentation for final N epochs (0 to keep enabled)
resume false (bool) resume training from last checkpoint in the run dir
amp true (bool | str) training precision: true/'fp16' (AMP, with a capability check), 'bf16', or false/'fp32'
fraction 1.0 (float | int | list) training fraction (1.0 = all), an image count if an integer > 1, or per-split values
profile false (bool) profile ONNX/TensorRT speeds during training for loggers
freeze null (int | list, optional) freeze first N layers (int), or specific layer indices or module names like '23.cv2' (list)
multi_scale 0.0 (float) multi-scale range as a fraction of imgsz
compile false (bool | str) enable torch.compile() backend='inductor'
distill_model null (str, optional) path to a teacher model for knowledge distillation
dis 6.0 (float) distillation loss weight

Segmentation

Key Default CLI Description
overlap_mask true (bool) merge instance masks into one mask during training
mask_ratio 4 (int) training mask downsample ratio (segment only); does not change the predicted mask resolution

Classification

Key Default CLI Description
dropout 0.0 (float) dropout for classification head (classify only)

Hyperparameters

Key Default CLI Description
lr0 0.01 (float) initial learning rate (SGD=1e-2, Adam/AdamW=1e-3)
lrf 0.01 (float) final LR fraction; final LR = lr0 * lrf
momentum 0.937 (float) SGD momentum or Adam beta1
weight_decay 0.0005 (float) weight decay (L2 regularization)
warmup_epochs 3.0 (float) warmup epochs (fractions allowed)
warmup_momentum 0.8 (float) initial momentum during warmup
warmup_bias_lr 0.1 (float) bias learning rate during warmup
box 7.5 (float) box loss gain
cls 0.5 (float) classification loss gain
cls_pw 0.0 (float) class weights power for class imbalance (0.0=disable, 1.0=full inverse)
dfl 1.5 (float) box distance loss gain (DFL when reg_max > 1, L1 on DFL-free YOLO26)
pose 12.0 (float) pose loss gain (pose tasks)
kobj 1.0 (float) keypoint objectness loss gain (pose tasks)
rle 1.0 (float) rle loss gain (pose tasks)
angle 1.0 (float) oriented angle loss gain (obb tasks)
dlog 1.0 (float) depth log (SILog) loss gain (depth tasks)
dgrad 0.5 (float) depth gradient loss gain (depth tasks)
dlam 1.0 (float) depth SILog variance focus: 1.0 = scale-invariant, 0.0 = log-RMSE (depth tasks)
nbs 64 (int) nominal batch size; gradients accumulate over round(nbs / batch) batches per optimizer step
hsv_h 0.015 (float) HSV hue augmentation fraction
hsv_s 0.7 (float) HSV saturation augmentation fraction
hsv_v 0.4 (float) HSV value (brightness) augmentation fraction
degrees 0.0 (float) rotation degrees (+/-)
translate 0.1 (float) translation fraction (+/-)
scale 0.5 (float | tuple) scale gain (+/-) as float, or explicit (min, max) tuple
shear 0.0 (float) shear degrees (+/-)
perspective 0.0 (float) perspective fraction (0–0.001 typical)
flipud 0.0 (float) vertical flip probability
fliplr 0.5 (float) horizontal flip probability
bgr 0.0 (float) RGB↔BGR channel swap probability
mosaic 1.0 (float) mosaic augmentation probability
mixup 0.0 (float) MixUp augmentation probability
cutmix 0.0 (float) CutMix augmentation probability
copy_paste 0.0 (float) segment/semantic/obb copy-paste fraction of eligible objects
copy_paste_mode flip (str) segment/semantic/obb copy-paste strategy: flip or mixup
auto_augment randaugment (str) classification auto augmentation: randaugment, autoaugment, augmix
erasing 0.4 (float) random erasing probability for classification (0.0–1.0)
cfg null (str, optional) path to a config.yaml that overrides Ultralytics defaults