Yolov8-源码解析-十九-
Yolov8 源码解析(十九)
description: Explore detailed documentation on convolution modules like Conv, LightConv, GhostConv, and more used in Ultralytics models.
keywords: Ultralytics, convolution modules, Conv, LightConv, GhostConv, YOLO, deep learning, neural networks
Reference for ultralytics/nn/modules/conv.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/nn/modules/conv.py) 🛠️. Thank you 🙏!
::: ultralytics.nn.modules.conv.Conv
::: ultralytics.nn.modules.conv.Conv2
::: ultralytics.nn.modules.conv.LightConv
::: ultralytics.nn.modules.conv.DWConv
::: ultralytics.nn.modules.conv.DWConvTranspose2d
::: ultralytics.nn.modules.conv.ConvTranspose
::: ultralytics.nn.modules.conv.Focus
::: ultralytics.nn.modules.conv.GhostConv
::: ultralytics.nn.modules.conv.RepConv
::: ultralytics.nn.modules.conv.ChannelAttention
::: ultralytics.nn.modules.conv.SpatialAttention
::: ultralytics.nn.modules.conv.CBAM
::: ultralytics.nn.modules.conv.Concat
::: ultralytics.nn.modules.conv.autopad
description: Explore docs covering Ultralytics YOLO detection, pose & RTDETRDecoder. Comprehensive guides to help you understand Ultralytics nn modules.
keywords: Ultralytics, YOLO, Detection, Pose, RTDETRDecoder, nn modules, guides
Reference for ultralytics/nn/modules/head.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/nn/modules/head.py) 🛠️. Thank you 🙏!
::: ultralytics.nn.modules.head.Detect
::: ultralytics.nn.modules.head.Segment
::: ultralytics.nn.modules.head.OBB
::: ultralytics.nn.modules.head.Pose
::: ultralytics.nn.modules.head.Classify
::: ultralytics.nn.modules.head.WorldDetect
::: ultralytics.nn.modules.head.RTDETRDecoder
::: ultralytics.nn.modules.head.v10Detect
description: Learn about Ultralytics transformer encoder, layer, MLP block, LayerNorm2d and the deformable transformer decoder layer. Expand your understanding of these crucial AI modules.
keywords: Ultralytics, Ultralytics documentation, TransformerEncoderLayer, TransformerLayer, MLPBlock, LayerNorm2d, DeformableTransformerDecoderLayer
Reference for ultralytics/nn/modules/transformer.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/nn/modules/transformer.py) 🛠️. Thank you 🙏!
::: ultralytics.nn.modules.transformer.TransformerEncoderLayer
::: ultralytics.nn.modules.transformer.AIFI
::: ultralytics.nn.modules.transformer.TransformerLayer
::: ultralytics.nn.modules.transformer.TransformerBlock
::: ultralytics.nn.modules.transformer.MLPBlock
::: ultralytics.nn.modules.transformer.MLP
::: ultralytics.nn.modules.transformer.LayerNorm2d
::: ultralytics.nn.modules.transformer.MSDeformAttn
::: ultralytics.nn.modules.transformer.DeformableTransformerDecoderLayer
::: ultralytics.nn.modules.transformer.DeformableTransformerDecoder
description: Explore the detailed reference of utility functions in the Ultralytics PyTorch modules. Learn about initialization, inverse sigmoid, and multiscale deformable attention.
keywords: Ultralytics, PyTorch, utils, initialization, inverse sigmoid, multiscale deformable attention, deep learning, neural networks
Reference for ultralytics/nn/modules/utils.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/nn/modules/utils.py) 🛠️. Thank you 🙏!
::: ultralytics.nn.modules.utils._get_clones
::: ultralytics.nn.modules.utils.bias_init_with_prob
::: ultralytics.nn.modules.utils.linear_init
::: ultralytics.nn.modules.utils.inverse_sigmoid
::: ultralytics.nn.modules.utils.multi_scale_deformable_attn_pytorch
description: Dive into the intricacies of YOLO tasks.py. Learn about DetectionModel, PoseModel and more for powerful AI development.
keywords: Ultralytics, YOLO, nn tasks, DetectionModel, PoseModel, RTDETRDetectionModel, model weights, parse model, AI development
Reference for ultralytics/nn/tasks.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/nn/tasks.py) 🛠️. Thank you 🙏!
::: ultralytics.nn.tasks.BaseModel
::: ultralytics.nn.tasks.DetectionModel
::: ultralytics.nn.tasks.OBBModel
::: ultralytics.nn.tasks.SegmentationModel
::: ultralytics.nn.tasks.PoseModel
::: ultralytics.nn.tasks.ClassificationModel
::: ultralytics.nn.tasks.RTDETRDetectionModel
::: ultralytics.nn.tasks.WorldModel
::: ultralytics.nn.tasks.Ensemble
::: ultralytics.nn.tasks.temporary_modules
::: ultralytics.nn.tasks.torch_safe_load
::: ultralytics.nn.tasks.attempt_load_weights
::: ultralytics.nn.tasks.attempt_load_one_weight
::: ultralytics.nn.tasks.parse_model
::: ultralytics.nn.tasks.yaml_model_load
::: ultralytics.nn.tasks.guess_model_scale
::: ultralytics.nn.tasks.guess_model_task
description: Explore the AI Gym class for real-time pose detection and gym step counting using Ultralytics YOLO. Learn to implement pose estimation effectively.
keywords: Ultralytics, AI Gym, YOLO, pose detection, gym step counting, real-time pose estimation, Python
Reference for ultralytics/solutions/ai_gym.py
!!! Note
This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/ai_gym.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/ai_gym.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/ai_gym.py) 🛠️. Thank you 🙏!
::: ultralytics.solutions.ai_gym.AIGym
description: Explore the Analytics class in Ultralytics for visual analytics. Learn to create and update line, bar, and pie charts efficiently.
keywords: Ultralytics, Analytics, Python, visual analytics, line chart, bar chart, pie chart, data visualization, AGPL-3.0 license
Reference for ultralytics/solutions/analytics.py
!!! Note
This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/analytics.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/analytics.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/analytics.py) 🛠️. Thank you 🙏!
::: ultralytics.solutions.analytics.Analytics
description: Explore the Ultralytics distance calculation module. Learn to calculate distances between objects in real-time video streams with our comprehensive guide.
keywords: Ultralytics, distance calculation, object tracking, real-time video, centroid, distance estimation, YOLO, ML, cv2
Reference for ultralytics/solutions/distance_calculation.py
!!! Note
This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/distance_calculation.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/distance_calculation.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/distance_calculation.py) 🛠️. Thank you 🙏!
::: ultralytics.solutions.distance_calculation.DistanceCalculation
description: Learn how to use the Ultralytics Heatmap module for real-time video analysis with object tracking and heatmap generation.
keywords: Ultralytics, Heatmap, Python, Real-time Video, Object Tracking, cv2, Shapely, Computer Vision, AI
Reference for ultralytics/solutions/heatmap.py
!!! Note
This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/heatmap.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/heatmap.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/heatmap.py) 🛠️. Thank you 🙏!
::: ultralytics.solutions.heatmap.Heatmap
description: Explore the Ultralytics Object Counter for real-time video streams. Learn about initializing parameters, tracking objects, and more.
keywords: Ultralytics, Object Counter, Real-time Tracking, Video Stream, Python, Object Detection
Reference for ultralytics/solutions/object_counter.py
!!! Note
This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/object_counter.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/object_counter.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/object_counter.py) 🛠️. Thank you 🙏!
::: ultralytics.solutions.object_counter.ObjectCounter
description: Explore Ultralytics' Parking Management solution leveraging YOLO for efficient parking zone monitoring and management.
keywords: Ultralytics, YOLO, parking management, computer vision, parking monitoring, AI solutions, machine learning
Reference for ultralytics/solutions/parking_management.py
!!! Note
This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/parking_management.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/parking_management.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/parking_management.py) 🛠️. Thank you 🙏!
::: ultralytics.solutions.parking_management.ParkingPtsSelection
::: ultralytics.solutions.parking_management.ParkingManagement
description: Discover the Ultralytics Queue Management script for real-time object tracking and queue management.
keywords: Ultralytics, queue management, object tracking, real-time video, Python script, YOLO, AGPL-3.0
Reference for ultralytics/solutions/queue_management.py
!!! Note
This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/queue_management.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/queue_management.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/queue_management.py) 🛠️. Thank you 🙏!
::: ultralytics.solutions.queue_management.QueueManager
description: Explore the Ultralytics YOLO-based speed estimation script for real-time object tracking and speed measurement, optimized for accuracy and performance.
keywords: Ultralytics, speed estimation, YOLO, real-time tracking, object tracking, python
Reference for ultralytics/solutions/speed_estimation.py
!!! Note
This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/speed_estimation.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/speed_estimation.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/speed_estimation.py) 🛠️. Thank you 🙏!
::: ultralytics.solutions.speed_estimation.SpeedEstimator
description: Explore the live inference capabilities of Streamlit combined with Ultralytics YOLOv8. Learn to implement real-time object detection in your web applications with our comprehensive guide.
keywords: Ultralytics, YOLOv8, live inference, real-time object detection, Streamlit, computer vision, webcam inference, object detection, Python, ML, cv2
Reference for ultralytics/solutions/streamlit_inference.py
!!! Note
This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/streamlit_inference.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/streamlit_inference.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/solutions/streamlit_inference.py) 🛠️. Thank you 🙏!
::: ultralytics.solutions.streamlit_inference.inference
description: Discover the BaseTrack classes and methods for object tracking in YOLO by Ultralytics. Learn about TrackState, BaseTrack attributes, and methods.
keywords: Ultralytics, YOLO, object tracking, BaseTrack, TrackState, tracking methods, TrackState enumeration, object detection
Reference for ultralytics/trackers/basetrack.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/basetrack.py) 🛠️. Thank you 🙏!
::: ultralytics.trackers.basetrack.TrackState
::: ultralytics.trackers.basetrack.BaseTrack
description: Explore the robust object tracking capabilities of the BOTrack and BOTSORT classes in the Ultralytics Bot SORT tracker API. Enhance your YOLOv8 projects.
keywords: Ultralytics, Bot SORT, BOTrack, BOTSORT, YOLOv8, object tracking, Kalman filter, ReID, GMC algorithm
Reference for ultralytics/trackers/bot_sort.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/bot_sort.py) 🛠️. Thank you 🙏!
::: ultralytics.trackers.bot_sort.BOTrack
::: ultralytics.trackers.bot_sort.BOTSORT
description: Explore the BYTETracker module in Ultralytics for state-of-the-art object tracking using Kalman filtering. Learn about its classes, methods, and attributes.
keywords: Ultralytics, BYTETracker, object tracking, Kalman filter, YOLOv8, documentation
Reference for ultralytics/trackers/byte_tracker.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/byte_tracker.py) 🛠️. Thank you 🙏!
::: ultralytics.trackers.byte_tracker.STrack
::: ultralytics.trackers.byte_tracker.BYTETracker
description: Explore the track.py script for Ultralytics object tracking. Learn how on_predict_start, on_predict_postprocess_end, and register_tracker functions work.
keywords: Ultralytics, YOLO, object tracking, track.py, on_predict_start, on_predict_postprocess_end, register_tracker
Reference for ultralytics/trackers/track.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/track.py) 🛠️. Thank you 🙏!
::: ultralytics.trackers.track.on_predict_start
::: ultralytics.trackers.track.on_predict_postprocess_end
::: ultralytics.trackers.track.register_tracker
description: Explore the Generalized Motion Compensation (GMC) class for tracking and object detection with methods like ORB, SIFT, ECC, and more.
keywords: GMC, Generalized Motion Compensation, Ultralytics, tracking, object detection, ORB, SIFT, ECC, Sparse Optical Flow, computer vision, video frames
Reference for ultralytics/trackers/utils/gmc.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/utils/gmc.py) 🛠️. Thank you 🙏!
::: ultralytics.trackers.utils.gmc.GMC
description: Explore Kalman filter implementations like KalmanFilterXYAH and KalmanFilterXYWH for tracking bounding boxes in image space using Ultralytics.
keywords: Kalman Filter, Object Tracking, Python, Ultralytics, YOLO, Bounding Boxes, Image Processing
Reference for ultralytics/trackers/utils/kalman_filter.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/utils/kalman_filter.py) 🛠️. Thank you 🙏!
::: ultralytics.trackers.utils.kalman_filter.KalmanFilterXYAH
::: ultralytics.trackers.utils.kalman_filter.KalmanFilterXYWH
description: Explore the utility functions for matching in trackers used by Ultralytics, including linear assignment, IoU distance, embedding distance, and more.
keywords: Ultralytics, matching utils, linear assignment, IoU distance, embedding distance, fuse score, tracking, Python, documentation
Reference for ultralytics/trackers/utils/matching.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/trackers/utils/matching.py) 🛠️. Thank you 🙏!
::: ultralytics.trackers.utils.matching.linear_assignment
::: ultralytics.trackers.utils.matching.iou_distance
::: ultralytics.trackers.utils.matching.embedding_distance
::: ultralytics.trackers.utils.matching.fuse_score
description: Discover how to automatically estimate the best YOLO batch size for optimal CUDA memory usage in PyTorch using Ultralytics' autobatch utility.
keywords: YOLO batch size, CUDA memory, PyTorch autobatch, Ultralytics, machine learning, optimal batch size, training batch size, YOLO model
Reference for ultralytics/utils/autobatch.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/autobatch.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.autobatch.check_train_batch_size
::: ultralytics.utils.autobatch.autobatch
description: Explore YOLO model benchmarking for speed and accuracy with formats like PyTorch, ONNX, TensorRT, and more. Detailed profiling & usage guides.
keywords: YOLO, model benchmarking, ONNX, TensorRT, PyTorch, TensorFlow, CoreML, profiling, Ultralytics, model performance
Reference for ultralytics/utils/benchmarks.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/benchmarks.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.benchmarks.RF100Benchmark
::: ultralytics.utils.benchmarks.ProfileModels
::: ultralytics.utils.benchmarks.benchmark
description: Discover the essential base callbacks in Ultralytics for training, validation, prediction, and exporting models efficiently.
keywords: Ultralytics, base callbacks, training, validation, prediction, model export, ML, machine learning, deep learning
Reference for ultralytics/utils/callbacks/base.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/base.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.callbacks.base.on_pretrain_routine_start
::: ultralytics.utils.callbacks.base.on_pretrain_routine_end
::: ultralytics.utils.callbacks.base.on_train_start
::: ultralytics.utils.callbacks.base.on_train_epoch_start
::: ultralytics.utils.callbacks.base.on_train_batch_start
::: ultralytics.utils.callbacks.base.optimizer_step
::: ultralytics.utils.callbacks.base.on_before_zero_grad
::: ultralytics.utils.callbacks.base.on_train_batch_end
::: ultralytics.utils.callbacks.base.on_train_epoch_end
::: ultralytics.utils.callbacks.base.on_fit_epoch_end
::: ultralytics.utils.callbacks.base.on_model_save
::: ultralytics.utils.callbacks.base.on_train_end
::: ultralytics.utils.callbacks.base.on_params_update
::: ultralytics.utils.callbacks.base.teardown
::: ultralytics.utils.callbacks.base.on_val_start
::: ultralytics.utils.callbacks.base.on_val_batch_start
::: ultralytics.utils.callbacks.base.on_val_batch_end
::: ultralytics.utils.callbacks.base.on_val_end
::: ultralytics.utils.callbacks.base.on_predict_start
::: ultralytics.utils.callbacks.base.on_predict_batch_start
::: ultralytics.utils.callbacks.base.on_predict_batch_end
::: ultralytics.utils.callbacks.base.on_predict_postprocess_end
::: ultralytics.utils.callbacks.base.on_predict_end
::: ultralytics.utils.callbacks.base.on_export_start
::: ultralytics.utils.callbacks.base.on_export_end
::: ultralytics.utils.callbacks.base.get_default_callbacks
::: ultralytics.utils.callbacks.base.add_integration_callbacks
description: Learn how to integrate ClearML with Ultralytics YOLO using detailed callbacks for pretraining, training, validation, and final logging.
keywords: Ultralytics, YOLO, ClearML, integration, callbacks, pretraining, training, validation, logging, AI, machine learning
Reference for ultralytics/utils/callbacks/clearml.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/clearml.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.callbacks.clearml._log_debug_samples
::: ultralytics.utils.callbacks.clearml._log_plot
::: ultralytics.utils.callbacks.clearml.on_pretrain_routine_start
::: ultralytics.utils.callbacks.clearml.on_train_epoch_end
::: ultralytics.utils.callbacks.clearml.on_fit_epoch_end
::: ultralytics.utils.callbacks.clearml.on_val_end
::: ultralytics.utils.callbacks.clearml.on_train_end
description: Explore the integration of Comet callbacks in Ultralytics YOLO, enabling advanced logging and monitoring for your machine learning experiments.
keywords: Ultralytics, YOLO, Comet, callbacks, logging, machine learning, monitoring, integration
Reference for ultralytics/utils/callbacks/comet.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/comet.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.callbacks.comet._get_comet_mode
::: ultralytics.utils.callbacks.comet._get_comet_model_name
::: ultralytics.utils.callbacks.comet._get_eval_batch_logging_interval
::: ultralytics.utils.callbacks.comet._get_max_image_predictions_to_log
::: ultralytics.utils.callbacks.comet._scale_confidence_score
::: ultralytics.utils.callbacks.comet._should_log_confusion_matrix
::: ultralytics.utils.callbacks.comet._should_log_image_predictions
::: ultralytics.utils.callbacks.comet._get_experiment_type
::: ultralytics.utils.callbacks.comet._create_experiment
::: ultralytics.utils.callbacks.comet._fetch_trainer_metadata
::: ultralytics.utils.callbacks.comet._scale_bounding_box_to_original_image_shape
::: ultralytics.utils.callbacks.comet._format_ground_truth_annotations_for_detection
::: ultralytics.utils.callbacks.comet._format_prediction_annotations_for_detection
::: ultralytics.utils.callbacks.comet._fetch_annotations
::: ultralytics.utils.callbacks.comet._create_prediction_metadata_map
::: ultralytics.utils.callbacks.comet._log_confusion_matrix
::: ultralytics.utils.callbacks.comet._log_images
::: ultralytics.utils.callbacks.comet._log_image_predictions
::: ultralytics.utils.callbacks.comet._log_plots
::: ultralytics.utils.callbacks.comet._log_model
::: ultralytics.utils.callbacks.comet.on_pretrain_routine_start
::: ultralytics.utils.callbacks.comet.on_train_epoch_end
::: ultralytics.utils.callbacks.comet.on_fit_epoch_end
::: ultralytics.utils.callbacks.comet.on_train_end
description: Learn to integrate DVCLive with Ultralytics for enhanced logging during training. Step-by-step methods for setting up and optimizing DVC callbacks.
keywords: Ultralytics, DVC, DVCLive, machine learning, logging, training, callbacks, integration
Reference for ultralytics/utils/callbacks/dvc.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/dvc.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.callbacks.dvc._log_images
::: ultralytics.utils.callbacks.dvc._log_plots
::: ultralytics.utils.callbacks.dvc._log_confusion_matrix
::: ultralytics.utils.callbacks.dvc.on_pretrain_routine_start
::: ultralytics.utils.callbacks.dvc.on_pretrain_routine_end
::: ultralytics.utils.callbacks.dvc.on_train_start
::: ultralytics.utils.callbacks.dvc.on_train_epoch_start
::: ultralytics.utils.callbacks.dvc.on_fit_epoch_end
::: ultralytics.utils.callbacks.dvc.on_train_end
description: Explore detailed guides on Ultralytics callbacks, including pretrain, model save, train start/end, and more. Enhance your ML training workflows with ease.
keywords: Ultralytics, callbacks, pretrain, model save, train start, train end, validation, predict, export, training, machine learning
Reference for ultralytics/utils/callbacks/hub.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/hub.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.callbacks.hub.on_pretrain_routine_start
::: ultralytics.utils.callbacks.hub.on_pretrain_routine_end
::: ultralytics.utils.callbacks.hub.on_fit_epoch_end
::: ultralytics.utils.callbacks.hub.on_model_save
::: ultralytics.utils.callbacks.hub.on_train_end
::: ultralytics.utils.callbacks.hub.on_train_start
::: ultralytics.utils.callbacks.hub.on_val_start
::: ultralytics.utils.callbacks.hub.on_predict_start
::: ultralytics.utils.callbacks.hub.on_export_start
description: Learn how to set up and customize MLflow logging for Ultralytics YOLO. Log metrics, parameters, and model artifacts easily.
keywords: MLflow, Ultralytics YOLO, logging, metrics, parameters, model artifacts, setup, tracking, customization
Reference for ultralytics/utils/callbacks/mlflow.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/mlflow.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.callbacks.mlflow.sanitize_dict
::: ultralytics.utils.callbacks.mlflow.on_pretrain_routine_end
::: ultralytics.utils.callbacks.mlflow.on_train_epoch_end
::: ultralytics.utils.callbacks.mlflow.on_fit_epoch_end
::: ultralytics.utils.callbacks.mlflow.on_train_end
description: Learn how to use NeptuneAI with Ultralytics for advanced logging and tracking of experiments. Detailed setup and callback functions included.
keywords: Ultralytics, NeptuneAI, YOLO, experiment logging, machine learning, AI, callbacks, training, validation
Reference for ultralytics/utils/callbacks/neptune.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/neptune.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.callbacks.neptune._log_scalars
::: ultralytics.utils.callbacks.neptune._log_images
::: ultralytics.utils.callbacks.neptune._log_plot
::: ultralytics.utils.callbacks.neptune.on_pretrain_routine_start
::: ultralytics.utils.callbacks.neptune.on_train_epoch_end
::: ultralytics.utils.callbacks.neptune.on_fit_epoch_end
::: ultralytics.utils.callbacks.neptune.on_val_end
::: ultralytics.utils.callbacks.neptune.on_train_end
description: Learn how to integrate Ray Tune with Ultralytics YOLO for efficient hyperparameter tuning and performance tracking.
keywords: Ultralytics, Ray Tune, hyperparameter tuning, YOLO, machine learning, deep learning, callbacks, integration, training metrics
Reference for ultralytics/utils/callbacks/raytune.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/raytune.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.callbacks.raytune.on_fit_epoch_end
description: Learn how to integrate and use TensorBoard with Ultralytics for effective model training visualization.
keywords: Ultralytics, TensorBoard, callbacks, machine learning, training visualization, logging
Reference for ultralytics/utils/callbacks/tensorboard.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/tensorboard.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.callbacks.tensorboard._log_scalars
::: ultralytics.utils.callbacks.tensorboard._log_tensorboard_graph
::: ultralytics.utils.callbacks.tensorboard.on_pretrain_routine_start
::: ultralytics.utils.callbacks.tensorboard.on_train_start
::: ultralytics.utils.callbacks.tensorboard.on_train_epoch_end
::: ultralytics.utils.callbacks.tensorboard.on_fit_epoch_end
description: Learn how Ultralytics YOLO integrates with WandB using custom callbacks for logging metrics and visualizations.
keywords: Ultralytics, YOLO, WandB, callbacks, logging, metrics, visualizations, AI, machine learning
Reference for ultralytics/utils/callbacks/wb.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/callbacks/wb.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.callbacks.wb._custom_table
::: ultralytics.utils.callbacks.wb._plot_curve
::: ultralytics.utils.callbacks.wb._log_plots
::: ultralytics.utils.callbacks.wb.on_pretrain_routine_start
::: ultralytics.utils.callbacks.wb.on_fit_epoch_end
::: ultralytics.utils.callbacks.wb.on_train_epoch_end
::: ultralytics.utils.callbacks.wb.on_train_end
description: Explore utility functions for Ultralytics YOLO such as checking versions, image sizes, and requirements.
keywords: Ultralytics, YOLO, utility functions, version checks, requirements, image size
Reference for ultralytics/utils/checks.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/checks.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.checks.parse_requirements
::: ultralytics.utils.checks.parse_version
::: ultralytics.utils.checks.is_ascii
::: ultralytics.utils.checks.check_imgsz
::: ultralytics.utils.checks.check_version
::: ultralytics.utils.checks.check_latest_pypi_version
::: ultralytics.utils.checks.check_pip_update_available
::: ultralytics.utils.checks.check_font
::: ultralytics.utils.checks.check_python
::: ultralytics.utils.checks.check_requirements
::: ultralytics.utils.checks.check_torchvision
::: ultralytics.utils.checks.check_suffix
::: ultralytics.utils.checks.check_yolov5u_filename
::: ultralytics.utils.checks.check_model_file_from_stem
::: ultralytics.utils.checks.check_file
::: ultralytics.utils.checks.check_yaml
::: ultralytics.utils.checks.check_is_path_safe
::: ultralytics.utils.checks.check_imshow
::: ultralytics.utils.checks.check_yolo
::: ultralytics.utils.checks.collect_system_info
::: ultralytics.utils.checks.check_amp
::: ultralytics.utils.checks.git_describe
::: ultralytics.utils.checks.print_args
::: ultralytics.utils.checks.cuda_device_count
::: ultralytics.utils.checks.cuda_is_available
description: Explore Ultralytics' utilities for distributed training including DDP file generation, command setup, and cleanup. Improve multi-node training efficiency.
keywords: Ultralytics, distributed training, DDP, multi-node training, network port, DDP file generation, DDP command, training utilities
Reference for ultralytics/utils/dist.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/dist.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.dist.find_free_network_port
::: ultralytics.utils.dist.generate_ddp_file
::: ultralytics.utils.dist.generate_ddp_command
::: ultralytics.utils.dist.ddp_cleanup
description: Explore and utilize the Ultralytics download utilities to handle URLs, zip/unzip files, and manage GitHub assets effectively.
keywords: Ultralytics, download utilities, URL validation, zip directory, unzip file, check disk space, Google Drive, GitHub assets, YOLO, machine learning
Reference for ultralytics/utils/downloads.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/downloads.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.downloads.is_url
::: ultralytics.utils.downloads.delete_dsstore
::: ultralytics.utils.downloads.zip_directory
::: ultralytics.utils.downloads.unzip_file
::: ultralytics.utils.downloads.check_disk_space
::: ultralytics.utils.downloads.get_google_drive_file_info
::: ultralytics.utils.downloads.safe_download
::: ultralytics.utils.downloads.get_github_assets
::: ultralytics.utils.downloads.attempt_download_asset
::: ultralytics.utils.downloads.download
description: Explore error handling for Ultralytics YOLO. Learn about custom exceptions like HUBModelError to manage model fetching issues effectively.
keywords: Ultralytics, YOLO, error handling, HUBModelError, model fetching, custom exceptions, Python
Reference for ultralytics/utils/errors.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/errors.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.errors.HUBModelError
description: Explore the utility functions and context managers in Ultralytics like WorkingDirectory, increment_path, file_size, and more. Enhance your file handling in Python.
keywords: Ultralytics, file utilities, Python, WorkingDirectory, increment_path, file_size, file_age, contexts, file handling, file management
Reference for ultralytics/utils/files.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/files.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.files.WorkingDirectory
::: ultralytics.utils.files.spaces_in_path
::: ultralytics.utils.files.increment_path
::: ultralytics.utils.files.file_age
::: ultralytics.utils.files.file_date
::: ultralytics.utils.files.file_size
::: ultralytics.utils.files.get_latest_run
::: ultralytics.utils.files.update_models
description: Explore Ultralytics utilities for bounding boxes and instances, providing detailed documentation on handling bbox formats, conversions, and more.
keywords: Ultralytics, bounding boxes, Instances, bbox formats, conversions, AI, deep learning, YOLO, xyxy, xywh, ltwh
Reference for ultralytics/utils/instance.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/instance.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.instance.Bboxes
::: ultralytics.utils.instance.Instances
::: ultralytics.utils.instance._ntuple
description: Explore detailed descriptions and implementations of various loss functions used in Ultralytics models, including Varifocal Loss, Focal Loss, Bbox Loss, and more.
keywords: Ultralytics, loss functions, Varifocal Loss, Focal Loss, Bbox Loss, Rotated Bbox Loss, Keypoint Loss, YOLO, model training, documentation
Reference for ultralytics/utils/loss.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/loss.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.loss.VarifocalLoss
::: ultralytics.utils.loss.FocalLoss
::: ultralytics.utils.loss.DFLoss
::: ultralytics.utils.loss.BboxLoss
::: ultralytics.utils.loss.RotatedBboxLoss
::: ultralytics.utils.loss.KeypointLoss
::: ultralytics.utils.loss.v8DetectionLoss
::: ultralytics.utils.loss.v8SegmentationLoss
::: ultralytics.utils.loss.v8PoseLoss
::: ultralytics.utils.loss.v8ClassificationLoss
::: ultralytics.utils.loss.v8OBBLoss
::: ultralytics.utils.loss.E2EDetectLoss
description: Explore detailed metrics and utility functions for model validation and performance analysis with Ultralytics' metrics module.
keywords: Ultralytics, metrics, model validation, performance analysis, IoU, confusion matrix
Reference for ultralytics/utils/metrics.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/metrics.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.metrics.ConfusionMatrix
::: ultralytics.utils.metrics.Metric
::: ultralytics.utils.metrics.DetMetrics
::: ultralytics.utils.metrics.SegmentMetrics
::: ultralytics.utils.metrics.PoseMetrics
::: ultralytics.utils.metrics.ClassifyMetrics
::: ultralytics.utils.metrics.OBBMetrics
::: ultralytics.utils.metrics.bbox_ioa
::: ultralytics.utils.metrics.box_iou
::: ultralytics.utils.metrics.bbox_iou
::: ultralytics.utils.metrics.mask_iou
::: ultralytics.utils.metrics.kpt_iou
::: ultralytics.utils.metrics._get_covariance_matrix
::: ultralytics.utils.metrics.probiou
::: ultralytics.utils.metrics.batch_probiou
::: ultralytics.utils.metrics.smooth_BCE
::: ultralytics.utils.metrics.smooth
::: ultralytics.utils.metrics.plot_pr_curve
::: ultralytics.utils.metrics.plot_mc_curve
::: ultralytics.utils.metrics.compute_ap
::: ultralytics.utils.metrics.ap_per_class
description: Explore detailed documentation on utility operations in Ultralytics including non-max suppression, bounding box transformations, and more.
keywords: Ultralytics, utility operations, non-max suppression, bounding box transformations, YOLOv8, machine learning
Reference for ultralytics/utils/ops.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/ops.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.ops.Profile
::: ultralytics.utils.ops.segment2box
::: ultralytics.utils.ops.scale_boxes
::: ultralytics.utils.ops.make_divisible
::: ultralytics.utils.ops.nms_rotated
::: ultralytics.utils.ops.non_max_suppression
::: ultralytics.utils.ops.clip_boxes
::: ultralytics.utils.ops.clip_coords
::: ultralytics.utils.ops.scale_image
::: ultralytics.utils.ops.xyxy2xywh
::: ultralytics.utils.ops.xywh2xyxy
::: ultralytics.utils.ops.xywhn2xyxy
::: ultralytics.utils.ops.xyxy2xywhn
::: ultralytics.utils.ops.xywh2ltwh
::: ultralytics.utils.ops.xyxy2ltwh
::: ultralytics.utils.ops.ltwh2xywh
::: ultralytics.utils.ops.xyxyxyxy2xywhr
::: ultralytics.utils.ops.xywhr2xyxyxyxy
::: ultralytics.utils.ops.ltwh2xyxy
::: ultralytics.utils.ops.segments2boxes
::: ultralytics.utils.ops.resample_segments
::: ultralytics.utils.ops.crop_mask
::: ultralytics.utils.ops.process_mask
::: ultralytics.utils.ops.process_mask_native
::: ultralytics.utils.ops.scale_masks
::: ultralytics.utils.ops.scale_coords
::: ultralytics.utils.ops.regularize_rboxes
::: ultralytics.utils.ops.masks2segments
::: ultralytics.utils.ops.convert_torch2numpy_batch
::: ultralytics.utils.ops.clean_str
description: Explore and contribute to Ultralytics' utils/patches.py. Learn about the imread, imwrite, imshow, and torch_save functions.
keywords: Ultralytics, utils, patches, imread, imwrite, imshow, torch_save, OpenCV, PyTorch, GitHub
Reference for ultralytics/utils/patches.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/patches.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.patches.imread
::: ultralytics.utils.patches.imwrite
::: ultralytics.utils.patches.imshow
::: ultralytics.utils.patches.torch_load
::: ultralytics.utils.patches.torch_save
description: Explore detailed functionalities of Ultralytics plotting utilities for data visualizations and custom annotations in ML projects.
keywords: ultralytics, plotting, utilities, documentation, data visualization, annotations, python, ML tools
Reference for ultralytics/utils/plotting.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/plotting.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.plotting.Colors
::: ultralytics.utils.plotting.Annotator
::: ultralytics.utils.plotting.plot_labels
::: ultralytics.utils.plotting.save_one_box
::: ultralytics.utils.plotting.plot_images
::: ultralytics.utils.plotting.plot_results
::: ultralytics.utils.plotting.plt_color_scatter
::: ultralytics.utils.plotting.plot_tune_results
::: ultralytics.utils.plotting.output_to_target
::: ultralytics.utils.plotting.output_to_rotated_target
::: ultralytics.utils.plotting.feature_visualization
description: Explore the TaskAlignedAssigner in Ultralytics YOLO. Learn about the TaskAlignedMetric and its applications in object detection.
keywords: Ultralytics, YOLO, TaskAlignedAssigner, object detection, machine learning, AI, Tal.py, PyTorch
Reference for ultralytics/utils/tal.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/tal.py) 🛠️. Thank you 🙏!
::: ultralytics.utils.tal.TaskAlignedAssigner
::: ultralytics.utils.tal.RotatedTaskAlignedAssigner
::: ultralytics.utils.tal.make_anchors
::: ultralytics.utils.tal.dist2bbox
::: ultralytics.utils.tal.bbox2dist
::: ultralytics.utils.tal.dist2rbox
description: Explore valuable torch utilities from Ultralytics for optimized model performance, including device selection, model fusion, and inference optimization.
keywords: Ultralytics, torch utils, model optimization, device selection, inference optimization, model fusion, CPU info, PyTorch tools
Reference for ultralytics/utils/torch_utils.py
!!! Note
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). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/utils/torch_utils.py) 🛠️. Thank you 🙏!