YOLOv8 **predict mode** can generate predictions for various tasks, returning either a list of `Results` objects or a
memory-efficient generator of `Results` objects when using the streaming mode. Enable streaming mode by
passing `stream=True` in the predictor's call method.
YOLOv8 **predict mode** can generate predictions for various tasks, returning either a list of `Results` objects or a memory-efficient generator of `Results` objects when using the streaming mode. Enable streaming mode by passing `stream=True` in the predictor's call method.
!!! example "Predict"
@ -27,7 +25,7 @@ passing `stream=True` in the predictor's call method.
boxes = result.boxes # Boxes object for bbox outputs
masks = result.masks # Masks object for segmentation masks outputs
keypoints = result.keypoints # Keypoints object for pose outputs
probs = result.probs # Class probabilities for classification outputs
probs = result.probs # Probs object for classification outputs
```
=== "Return a generator with `stream=True`"
@ -45,7 +43,7 @@ passing `stream=True` in the predictor's call method.
boxes = result.boxes # Boxes object for bbox outputs
masks = result.masks # Masks object for segmentation masks outputs
keypoints = result.keypoints # Keypoints object for pose outputs
probs = result.probs # Class probabilities for classification outputs
probs = result.probs # Probs object for classification outputs
```
## Inference Sources
@ -281,45 +279,52 @@ Below are code examples for using each source type:
## Inference Arguments
`model.predict` accepts multiple arguments that control the prediction operation. These arguments can be passed directly to `model.predict`:
`model.predict()` accepts multiple arguments that can be passed at inference time to override defaults:
| `classes` | `None or list` | `None` | filter results by class, i.e. class=0, or class=[0,2,3] |
| `boxes` | `bool` | `True` | Show boxes in segmentation predictions |
## Image and Video Formats
YOLOv8 supports various image and video formats, as specified in [data/utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/utils.py). See the tables below for the valid suffixes and example predict commands.
### Image Suffixes
### Images
The below table contains valid Ultralytics image formats.
| `cpu()` | Method | Returns a copy of the probs tensor on CPU memory. |
| `numpy()` | Method | Returns a copy of the probs tensor as a numpy array. |
| `cuda()` | Method | Returns a copy of the probs tensor on GPU memory. |
| `to()` | Method | Returns a copy of the probs tensor with the specified device and dtype. |
| `top1` | Property `int` | Index of the top 1 class. |
| `top5` | Property `list[int]` | Indices of the top 5 classes. |
| `top1conf` | Property `torch.Tensor` | Confidence of the top 1 class. |
| `top5conf` | Property `torch.Tensor` | Confidences of the top 5 classes. |
You can use `plot()` function of `Result` object to plot results on in image object. It plots all components(boxes,
masks, classification probabilities, etc.) found in the results object
For more details see the `Probs` class [documentation](../reference/engine/results.md#probs).
## Plotting Results
You can the `plot()` method of a `Result` objects to plot predictions. It plots all prediction types (boxes, masks, keypoints, probabilities, etc.) contained in the `Results` object.
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg.py).
@ -3,7 +3,12 @@ description: Enhance your machine learning model with Ultralytics’ auto_annota
keywords: Ultralytics, Auto-Annotate, Machine Learning, AI, Annotation, Data Processing, Model Training
---
## auto_annotate
# Reference for `ultralytics/data/annotator.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/annotator.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/annotator.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/augment.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/augment.py).
@ -3,7 +3,12 @@ description: Explore BaseDataset in Ultralytics docs. Learn how this implementat
keywords: Ultralytics, docs, BaseDataset, data manipulation, dataset creation
---
## BaseDataset
# Reference for `ultralytics/data/base.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/base.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/base.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/build.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/build.py).
@ -3,32 +3,32 @@ description: Explore Ultralytics data converter functions like coco91_to_coco80_
keywords: Ultralytics, Data Converter, coco91_to_coco80_class, merge_multi_segment, rle2polygon
---
## coco91_to_coco80_class
# Reference for `ultralytics/data/converter.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/converter.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/converter.py).
@ -3,17 +3,20 @@ description: Explore the YOLODataset and SemanticDataset classes in YOLO data. L
keywords: Ultralytics, YOLO, YOLODataset, SemanticDataset, data handling, data manipulation
---
## YOLODataset
# Reference for `ultralytics/data/dataset.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/dataset.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/dataset.py).
@ -3,42 +3,40 @@ description: Find detailed guides on Ultralytics YOLO data loaders, including Lo
keywords: Ultralytics, data loaders, LoadStreams, LoadImages, LoadTensor, YOLO, YouTube URLs
---
## SourceTypes
# Reference for `ultralytics/data/loaders.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/loaders.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/loaders.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/data/utils.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/exporter.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/exporter.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/model.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/model.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/predictor.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/predictor.py).
@ -3,32 +3,32 @@ description: Master Ultralytics engine results including base tensors, boxes, an
keywords: Ultralytics, engine, results, base tensor, boxes, keypoints
---
## BaseTensor
# Reference for `ultralytics/engine/results.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/results.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/results.py).
@ -3,7 +3,12 @@ description: Learn about the BaseTrainer class in the Ultralytics library. From
keywords: Ultralytics, BaseTrainer, Machine Learning, Training Control, Python library
---
## BaseTrainer
# Reference for `ultralytics/engine/trainer.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/trainer.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/trainer.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/validator.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/engine/validator.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub.py).
@ -3,7 +3,12 @@ description: Dive into the Ultralytics Auth API documentation & learn how to man
keywords: Ultralytics, Auth, API documentation, User Authentication, AI, Machine Learning
---
## Auth
# Reference for `ultralytics/hub/auth.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/auth.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/auth.py).
@ -3,7 +3,12 @@ description: Explore details about the HUBTrainingSession in Ultralytics framewo
keywords: Ultralytics, HUBTrainingSession, Documentation, Model Training, AI, Machine Learning, YOLO
---
## HUBTrainingSession
# Reference for `ultralytics/hub/session.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/session.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/session.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/hub/utils.py).
@ -3,7 +3,12 @@ description: Learn all about Ultralytics FastSAM model. Dive into our comprehens
keywords: Ultralytics, FastSAM model, Model documentation, Efficient model training
---
## FastSAM
# Reference for `ultralytics/models/fastsam/model.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/model.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/model.py).
@ -3,7 +3,12 @@ description: Get detailed insights about Ultralytics FastSAMPredictor. Learn to
keywords: Ultralytics, FastSAMPredictor, predictive modeling, AI optimization, machine learning, deep learning, Ultralytics documentation
---
## FastSAMPredictor
# Reference for `ultralytics/models/fastsam/predict.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/predict.py).
# Reference for `ultralytics/models/fastsam/prompt.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/prompt.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/prompt.py).
# Reference for `ultralytics/models/fastsam/utils.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/utils.py).
# Reference for `ultralytics/models/fastsam/val.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/fastsam/val.py).
@ -3,7 +3,12 @@ description: Learn how our NAS model operates in Ultralytics. Comprehensive guid
keywords: Ultralytics, NAS model, NAS guide, machine learning, model documentation
---
## NAS
# Reference for `ultralytics/models/nas/model.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/nas/model.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/nas/model.py).
keywords: NASPredictor, Ultralytics, Ultralytics model, model architecture, efficient predictions
---
## NASPredictor
# Reference for `ultralytics/models/nas/predict.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/nas/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/nas/predict.py).
@ -3,7 +3,12 @@ description: Explore the utilities and functions of the Ultralytics NASValidator
keywords: Ultralytics, NASValidator, models.nas.val.NASValidator, AI models, allocation, optimization
---
## NASValidator
# Reference for `ultralytics/models/nas/val.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/nas/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/nas/val.py).
# Reference for `ultralytics/models/rtdetr/model.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/model.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/model.py).
@ -3,7 +3,12 @@ description: Learn how to use the RTDETRPredictor model of the Ultralytics packa
keywords: Ultralytics, RTDETRPredictor, model documentation, guide, real-time object detection
---
## RTDETRPredictor
# Reference for `ultralytics/models/rtdetr/predict.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/predict.py).
@ -3,12 +3,16 @@ description: Get insights into RTDETRTrainer, a crucial component of Ultralytics
keywords: Ultralytics, RTDETRTrainer, model training, Ultralytics models, PyTorch models, neural networks, machine learning, deep learning
---
## RTDETRTrainer
# Reference for `ultralytics/models/rtdetr/train.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/train.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/train.py).
# Reference for `ultralytics/models/rtdetr/val.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/val.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/amg.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/amg.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/build.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/build.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/model.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/model.py).
# Reference for `ultralytics/models/sam/modules/decoders.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/decoders.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/decoders.py).
# Reference for `ultralytics/models/sam/modules/encoders.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/encoders.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/encoders.py).
@ -3,7 +3,12 @@ description: Explore the Sam module of Ultralytics. Discover detailed methods, c
keywords: Ultralytics, Sam module, deep learning, model training, Ultralytics documentation
---
## Sam
# Reference for `ultralytics/models/sam/modules/sam.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/sam.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/sam.py).
# Reference for `ultralytics/models/sam/modules/tiny_encoder.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/tiny_encoder.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/tiny_encoder.py).
@ -3,17 +3,20 @@ description: Learn about TwoWayTransformer and Attention modules in Ultralytics.
keywords: Ultralytics, TwoWayTransformer, Attention, AI models, transformers
---
## TwoWayTransformer
# Reference for `ultralytics/models/sam/modules/transformer.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/transformer.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/transformer.py).
# Reference for `ultralytics/models/sam/predict.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/predict.py).
# Reference for `ultralytics/models/utils/loss.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/utils/loss.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/utils/loss.py).
keywords: Ultralytics, YOLO, HungarianMatcher, inverse_sigmoid, detection models, model utilities, ops
---
## HungarianMatcher
# Reference for `ultralytics/models/utils/ops.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/utils/ops.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/utils/ops.py).
@ -3,12 +3,16 @@ description: Explore the Ultralytics ClassificationPredictor guide for model pre
keywords: Ultralytics, classification predictor, predict, YOLO, AI models, model visualization
---
## ClassificationPredictor
# Reference for `ultralytics/models/yolo/classify/predict.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/predict.py).
@ -3,12 +3,16 @@ description: Delve into Classification Trainer at Ultralytics YOLO docs and opti
keywords: Ultralytics, YOLO, Classification Trainer, deep learning, training process, AI models, documentation
---
## ClassificationTrainer
# Reference for `ultralytics/models/yolo/classify/train.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/train.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/train.py).
@ -3,12 +3,16 @@ description: Explore YOLO ClassificationValidator, a key element of Ultralytics
keywords: Ultralytics, YOLO, ClassificationValidator, model validation, model fine-tuning, deep learning, computer vision
---
## ClassificationValidator
# Reference for `ultralytics/models/yolo/classify/val.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/val.py).
# Reference for `ultralytics/models/yolo/detect/predict.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/detect/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/detect/predict.py).
@ -3,12 +3,16 @@ description: Maximize your model's potential with Ultralytics YOLO Detection Tra
keywords: Ultralytics YOLO, YOLO, Detection Trainer, Model Training, Machine Learning, Deep Learning, Computer Vision
---
## DetectionTrainer
# Reference for `ultralytics/models/yolo/detect/train.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/detect/train.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/detect/train.py).
@ -3,12 +3,16 @@ description: Discover function valuation of your YOLO models with the Ultralytic
keywords: Ultralytics, YOLO, Detection Validator, model valuation, precision, recall
---
## DetectionValidator
# Reference for `ultralytics/models/yolo/detect/val.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/detect/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/detect/val.py).
@ -3,7 +3,12 @@ description: Discover the Ultralytics YOLO model class. Learn advanced technique
keywords: Ultralytics YOLO, YOLO, YOLO model, Model Training, Machine Learning, Deep Learning, Computer Vision
---
## YOLO
# Reference for `ultralytics/models/yolo/model.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/model.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/model.py).
# Reference for `ultralytics/models/yolo/pose/predict.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/pose/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/pose/predict.py).
@ -3,12 +3,16 @@ description: Explore Ultralytics PoseTrainer for YOLO models. Get a step-by-step
keywords: Ultralytics, YOLO, PoseTrainer, pose training, AI modeling, custom data training
---
## PoseTrainer
# Reference for `ultralytics/models/yolo/pose/train.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/pose/train.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/pose/train.py).
# Reference for `ultralytics/models/yolo/pose/val.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/pose/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/pose/val.py).
# Reference for `ultralytics/models/yolo/segment/predict.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/segment/predict.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/segment/predict.py).
@ -3,12 +3,16 @@ description: Maximize your YOLO model's performance with our SegmentationTrainer
keywords: Ultralytics, YOLO, SegmentationTrainer, image segmentation, object detection, model training, YOLO model
---
## SegmentationTrainer
# Reference for `ultralytics/models/yolo/segment/train.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/segment/train.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/segment/train.py).
@ -3,12 +3,16 @@ description: Get practical insights about our SegmentationValidator in YOLO Ultr
keywords: Ultralytics, YOLO, SegmentationValidator, model segmentation, image classification, object detection
---
## SegmentationValidator
# Reference for `ultralytics/models/yolo/segment/val.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/segment/val.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/segment/val.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/autobackend.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/autobackend.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/block.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/block.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/conv.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/conv.py).
keywords: Ultralytics, YOLO, Detection, Pose, RTDETRDecoder, nn modules, guides
---
## Detect
# Reference for `ultralytics/nn/modules/head.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/head.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/head.py).
# Reference for `ultralytics/nn/modules/transformer.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/transformer.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/transformer.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/utils.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/tasks.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/tasks.py).
# Reference for `ultralytics/trackers/basetrack.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/basetrack.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/basetrack.py).
@ -3,12 +3,16 @@ description: Master the use of Ultralytics BOTrack, a key component of the power
keywords: Ultralytics, BOTSORT, BOTrack, tracking system, official documentation, machine learning, AI tracking
---
## BOTrack
# Reference for `ultralytics/trackers/bot_sort.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/bot_sort.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/bot_sort.py).
# Reference for `ultralytics/trackers/byte_tracker.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/byte_tracker.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/byte_tracker.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/track.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/track.py).
# Reference for `ultralytics/trackers/utils/gmc.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/utils/gmc.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/utils/gmc.py).
# Reference for `ultralytics/trackers/utils/kalman_filter.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/utils/kalman_filter.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/utils/kalman_filter.py).
# Reference for `ultralytics/trackers/utils/matching.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/utils/matching.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/utils/matching.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/autobatch.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/autobatch.py).
@ -3,12 +3,16 @@ description: Discover how to profile your models using Ultralytics utilities. En
keywords: Ultralytics, ProfileModels, benchmarks, model profiling, performance optimization
---
## ProfileModels
# Reference for `ultralytics/utils/benchmarks.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/benchmarks.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/benchmarks.py).
# Reference for `ultralytics/utils/callbacks/base.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/base.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/base.py).
@ -3,37 +3,36 @@ description: Uncover the specifics of Ultralytics ClearML callbacks, from pretra
keywords: Ultralytics, clearML, callbacks, pretrain routine start, validation end, train epoch end, training end
---
## _log_debug_samples
# Reference for `ultralytics/utils/callbacks/clearml.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/clearml.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/clearml.py).
@ -3,122 +3,104 @@ description: Explore comprehensive documentation for utilising Comet Callbacks i
keywords: Ultralytics, Comet Callbacks, Training optimisation, Logging, Experiment Workflows
---
## _get_comet_mode
# Reference for `ultralytics/utils/callbacks/comet.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/comet.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/comet.py).
# Reference for `ultralytics/utils/callbacks/dvc.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/dvc.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/dvc.py).
@ -3,42 +3,40 @@ description: Explore the detailed information on key Ultralytics callbacks such
keywords: Ultralytics, callbacks, on_pretrain_routine_end, on_model_save, on_train_start, on_predict_start, hub, training
---
## on_pretrain_routine_end
# Reference for `ultralytics/utils/callbacks/hub.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/hub.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/hub.py).
@ -3,17 +3,20 @@ description: Understand routines at the end of pre-training and training in Ultr
keywords: Ultralytics, MLflow, Callbacks, on_pretrain_routine_end, on_train_end, Machine Learning, Training
---
## on_pretrain_routine_end
# Reference for `ultralytics/utils/callbacks/mlflow.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/mlflow.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/mlflow.py).
# Reference for `ultralytics/utils/callbacks/neptune.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/neptune.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/neptune.py).
@ -3,7 +3,12 @@ description: Discover the functionality of the on_fit_epoch_end callback in the
keywords: Ultralytics, YOLO, on_fit_epoch_end, callbacks, documentation, deep learning, YOLO framework
---
## on_fit_epoch_end
# Reference for `ultralytics/utils/callbacks/raytune.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/raytune.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/raytune.py).
# Reference for `ultralytics/utils/callbacks/tensorboard.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/tensorboard.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/tensorboard.py).
# Reference for `ultralytics/utils/callbacks/wb.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/wb.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/wb.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/checks.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/checks.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/dist.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/dist.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/downloads.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/downloads.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/errors.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/errors.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/files.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/files.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/instance.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/instance.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/loss.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/loss.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/metrics.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/metrics.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/ops.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/ops.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/patches.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/patches.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/plotting.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/plotting.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/tal.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/tal.py).
@ -3,137 +3,116 @@ description: Explore Ultralytics-tailored torch utility features like Model EMA,
keywords: Ultralytics, Torch Utils, Model EMA, Early Stopping, Smart Inference, Get CPU Info, Time Sync, Fuse Deconv and bn, Get num params, Get FLOPs, Scale img, Copy attr, Intersect dicts, De_parallel, Init seeds, Profile
---
## ModelEMA
# Reference for `ultralytics/utils/torch_utils.py`
!!! note
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/torch_utils.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/torch_utils.py).
Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/tuner.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/tuner.py).