Ultralytics YOLOv5 offers PyTorch models and tooling for object detection, instance segmentation, and image classification. You can train on custom data, run inference, validate results, and export to several deployment formats.
Overview
Ultralytics YOLOv5 is a computer vision model built on PyTorch for object detection, instance segmentation, and image classification. It is aimed at real-time vision workloads and includes pretrained checkpoints trained on datasets such as COCO and ImageNet.
The project ships scripts and workflows for training, validation, and inference. You can load models through PyTorch Hub or run inference with detect.py, which accepts various input sources and writes outputs under runs/detect. Training supports custom datasets, multi-GPU setups, transfer learning with frozen layers, hyperparameter tuning, and techniques such as test-time augmentation and model ensembling.
Instance segmentation and classification variants have dedicated train, validate, and predict flows. Models can be exported to formats including ONNX, TensorRT, CoreML, and TFLite using export.py. Documentation covers pruning, integrations with logging and dataset tools, and setup on cloud notebooks or Docker.
Ultralytics also maintains newer YOLO families and an ultralytics package with additional tasks; YOLOv5 remains documented as a mature option for detection, segmentation, and classification when you want this architecture and workflow.
Key features
- Object detection with COCO-pretrained checkpoints
- Instance segmentation models and workflows
- Image classification with YOLOv5-cls models
- Training and validation on custom datasets
- Inference via PyTorch Hub or detect.py
- Export to ONNX, TensorRT, CoreML, and TFLite
- Multi-GPU training and AutoBatch support
- Test-time augmentation and model ensembling
Use cases
- Real-time object detection in vision pipelines
- Training detection models on labeled custom data
- Instance segmentation on images
- Image classification with exported checkpoints
- Deploying models through ONNX or TensorRT exports