YOLOv5: PyTorch object detection model
Real-time object detection with cross-platform deployment support.
Learn more about yolov5
YOLOv5 is an object detection model implemented in PyTorch that processes images to identify and localize objects within them. The architecture uses a convolutional neural network approach optimized for real-time inference across different hardware targets. It provides built-in export capabilities to multiple formats, enabling deployment on diverse platforms from desktop systems to mobile devices and edge hardware. Common applications include surveillance systems, autonomous vehicle perception, industrial inspection, and general-purpose computer vision tasks requiring object localization.
Multi-Format Model Export
Convert trained models to ONNX, CoreML, TFLite, and other formats from a single PyTorch checkpoint. Enables deployment across mobile, edge, and cloud platforms without retraining or maintaining separate implementations.
PyTorch-Native Implementation
Built entirely on PyTorch framework for direct access to the ecosystem's tools and libraries. Allows standard Python workflows for model customization, fine-tuning, and integration with existing PyTorch pipelines.
Unified Multi-Task Architecture
Single codebase handles object detection, instance segmentation, and classification tasks with shared training infrastructure. Reduces maintenance overhead and enables task switching without learning new frameworks or toolchains.
import torch
# Load pre-trained model
model = torch.hub.load('ultralytics/yolov5', 'yolov5s')
# Run inference on an image
results = model('https://ultralytics.com/images/zidane.jpg')
# Display results
results.show()
results.print()v7.0 - YOLOv5 SOTA Realtime Instance Segmentation
- –Segmentation Models ⭐ NEW**: SOTA YOLOv5-seg COCO-pretrained segmentation models are now available for the first time ( by @glenn-jocher, @AyushExel and @Laughing-q)
- –Paddle Paddle Export**: Export any YOLOv5 model (cls, seg, det) to Paddle format with python export.py --include paddle ( by @glenn-jocher)
- –Comet Logging and Visualization Integration:** Free forever, Comet lets you save YOLOv5 models, resume training, and interactively visualise and debug predictions. ( by @DN6)
- –Accuracy** values are for single-model single-scale on COCO dataset.<br>Reproduce by `python segment/val.py --data coco.yaml --weights yolov5s-seg.pt`
- –Export** to ONNX at FP32 and TensorRT at FP16 done with `export.py`. <br>Reproduce by `python export.py --weights yolov5s-seg.pt --include engine --device 0 --half`
v6.2 - YOLOv5 Classification Models, Apple M1, Reproducibility, ClearML and Deci.ai integrations
- –Classification Models ⭐ NEW**: YOLOv5-cls ImageNet-pretrained classification models are now available for the first time ( by @glenn-jocher)
- –Deci.ai optimization ⭐ NEW**: Automatically compile and quantize YOLOv5 for better inference performance in one click at Deci ( by @glenn-jocher).
- –Training Reproducibility**: Single-GPU YOLOv5 training with `torch>=1.12.0` is now fully reproducible, and a new `--seed` argument can be used (default seed=0) ( by @AyushExel).
- –Apple Metal Performance Shader (MPS) Support**: MPS support for Apple M1/M2 devices with `--device mps` (full functionality is pending torch updates in ( by @glenn-jocher)
- –Accuracy** values are for single-model single-scale on ImageNet-1k dataset.<br>Reproduce by `python classify/val.py --data../datasets/imagenet --img 224`
v6.1 - TensorRT, TensorFlow Edge TPU and OpenVINO Export and Inference
- –TensorRT support**: TensorFlow, Keras, TFLite, TF.js model export now fully integrated using `python export.py --include saved_model pb tflite tfjs` ( by @imyhxy)
- –Tensorflow Edge TPU support ⭐ NEW**: New smaller YOLOv5n (1.9M params) model below YOLOv5s (7.5M params), exports to 2.1 MB INT8 size, ideal for ultralight mobile solutions. ( by @zldrobit)
- –OpenVINO support**: YOLOv5 ONNX models are now compatible with both OpenCV DNN and ONNX Runtime ( by @glenn-jocher).
- –Architecture:** no changes
- –Hyperparameters:** minor change
See how people are using yolov5
Top in AI & ML
Related Repositories
Discover similar tools and frameworks used by developers
crewAI
Python framework for autonomous multi-agent AI collaboration.
Weights & Biases
ML experiment tracking platform with logging, visualization, and model versioning.
stable-diffusion-webui
Web UI for Stable Diffusion enabling AI image generation and editing in browser.
mmdetection
Modular PyTorch framework for object detection research and deployment.
ComfyUI-Manager
Graphical package manager for ComfyUI custom nodes.