Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
Y

yolov5

> 编程语言
Open source

Ultralytics YOLOv5 in PyTorch for object detection, instance segmentation, classification, training, and export.

57.8K stars0 likes1 views
WebsiteGitHub

About

Ultralytics YOLOv5 in PyTorch for object detection, instance segmentation, classification, training, and export.


Ultralytics YOLOv5 🚀 is a fast, accurate, and easy-to-use computer vision model developed by Ultralytics. Based on the PyTorch framework, YOLOv5 is renowned for its speed, accuracy, and simplicity. It incorporates insights and best practices from extensive research and development, making it a popular and reliable choice for a wide range of vision AI tasks, including object detection, image segmentation, and image classification.

We hope the resources here help you get the most out of YOLOv5. Please browse the YOLOv5 Docs for detailed information, raise an issue on GitHub for support, and join our Discord community for questions and discussions!

To request an Enterprise License, please complete the form at Ultralytics Licensing.


🚀 Explore the Ultralytics YOLO Ecosystem

YOLOv5 is a mature, production-proven model that remains an excellent choice for fast and reliable object detection, instance segmentation, and image classification. If your project calls for the newest architectures, additional tasks such as pose estimation and oriented object detection (OBB), or a unified Python and CLI interface, the actively maintained ultralytics package brings the latest Ultralytics YOLO models together in one place. Explore the Ultralytics Docs to find the best fit for your use case.

bash
# Install the ultralytics package for the latest Ultralytics YOLO models
pip install ultralytics

📚 Documentation

See the YOLOv5 Docs for full documentation on training, testing, and deployment. See below for quickstart examples.

Install

Clone the repository and install dependencies in a Python>=3.8.0 environment. Ensure you have PyTorch>=1.8 installed.

bash
# Clone the YOLOv5 repository
git clone https://github.com/ultralytics/yolov5

# Navigate to the cloned directory
cd yolov5

# Install required packages
pip install -r requirements.txt
Inference with PyTorch Hub

Use YOLOv5 via PyTorch Hub for inference. Models are automatically downloaded from the latest YOLOv5 release.

…
Inference with detect.py

The detect.py script runs inference on various sources. It automatically downloads models from the latest YOLOv5 release and saves the results to the runs/detect directory.

…
Training

The commands below demonstrate how to reproduce YOLOv5 COCO dataset results. Both models and datasets are downloaded automatically from the latest YOLOv5 release. Training times for YOLOv5n/s/m/l/x are approximately 1/2/4/6/8 days on a single NVIDIA V100 GPU. Using Multi-GPU training can significantly reduce training time. Use the largest --batch-size your hardware allows, or use --batch-size -1 for YOLOv5 AutoBatch. The batch sizes shown below are for V100-16GB GPUs.

…
Tutorials
  • Train Custom Data 🚀 RECOMMENDED: Learn how to train YOLOv5 on your own datasets.
  • Tips for Best Training Results ☘️: Improve your model's performance with expert tips.
  • Multi-GPU Training: Speed up training using multiple GPUs.
  • PyTorch Hub Integration: Easily load models using PyTorch Hub.
  • Model Export (TFLite, ONNX, CoreML, TensorRT) 🚀: Convert your models to various deployment formats like ONNX or TensorRT.
  • NVIDIA Jetson Deployment: Deploy YOLOv5 on NVIDIA Jetson devices.
  • Test-Time Augmentation (TTA): Enhance prediction accuracy with TTA.
  • Model Ensembling: Combine multiple models for better performance.
  • Model Pruning/Sparsity: Optimize models for size and speed.
  • Hyperparameter Evolution: Automatically find the best training hyperparameters.
  • Transfer Learning with Frozen Layers: Adapt pretrained models to new tasks efficiently using transfer learning.
  • Architecture Summary: Understand the YOLOv5 model architecture.
  • Ultralytics Platform Training 🚀 RECOMMENDED: Train and deploy YOLO models using Ultralytics Platform.
  • ClearML Logging: Integrate with ClearML for experiment tracking.
  • Neural Magic DeepSparse Integration: Accelerate inference with DeepSparse.
  • Comet Logging: Log experiments using Comet ML.

🧩 Integrations

Our key integrations with leading AI platforms extend the functionality of Ultralytics' offerings, enhancing tasks like dataset labeling, training, visualization, and model management. Discover how Ultralytics, in collaboration with partners like Weights & Biases, Comet ML, Roboflow, and Intel OpenVINO, can optimize your AI workflow. Explore more at Ultralytics Integrations.

🤔 Why YOLOv5?

YOLOv5 is designed for simplicity and ease of use. We prioritize real-world performance and accessibility.

YOLOv5-P5 640 Figure

Figure Notes
  • COCO AP val denotes the mean Average Precision (mAP) at Intersection over Union (IoU) thresholds from 0.5 to 0.95, measured on the 5,000-image COCO val2017 dataset across various inference sizes (256 to 1536 pixels).
  • GPU Speed measures the average inference time per image on the COCO val2017 dataset using an AWS p3.2xlarge V100 instance with a batch size of 32.
  • EfficientDet data is sourced from the google/automl repository at batch size 8.
  • Reproduce these results using the command: python val.py --task study --data coco.yaml --iou 0.7 --weights yolov5n6.pt yolov5s6.pt yolov5m6.pt yolov5l6.pt yolov5x6.pt

Pretrained Checkpoints

This table shows the performance metrics for various YOLOv5 models trained on the COCO dataset.

Model Size
(pixels)
mAPval
50-95
mAPval
50
Speed
CPU b1
(ms)
Speed
V100 b1
(ms)
Speed
V100 b32
(ms)
Params
(M)
FLOPs
@640 (B)
YOLOv5n 640 28.0 45.7 45 6.3 0.6 1.9 4.5
YOLOv5s 640 37.4 56.8 98 6.4 0.9 7.2 16.5
YOLOv5m 640 45.4 64.1 224 8.2 1.7 21.2 49.0
YOLOv5l 640 49.0 67.3 430 10.1 2.7 46.5 109.1
YOLOv5x 640 50.7 68.9 766 12.1 4.8 86.7 205.7

Issues· 31 open

View all issuesOpen on GitHub
  • #13871

    เว็บ สล็อตเว็บตรง เว็บแท้ สล็อต pg เว็บตรง แตกหนัก RTP สูงสุด 98% รับวอเลท

    enhancementpriority: highUpdated Sep 10, 2026
  • #13796

    New YOLO models live in ultralytics/ultralytics

    documentationenhancementpriority: lowUpdated Sep 4, 2026
  • #10395

    YOLOv5 with PyTorch 2.0

    questionTODOUpdated Jul 7, 2026
  • #36

    Load YOLOv5 from PyTorch Hub ⭐

    documentationenhancementUpdated Apr 17, 2026
  • #1276

    iOS iDetection Speed Table

    documentationenhancementhelp wantedUpdated Feb 12, 2026
  • #475

    Multi-GPU Training

    documentationenhancementUpdated Dec 15, 2025
  • #4975

    Roboflow for Datasets, Labeling, and Active Learning

    documentationUpdated Mar 19, 2025
  • #12

    Train Custom Data Tutorial ⭐

    documentationUpdated Dec 10, 2024
  • #6998

    YOLOv5 (6.0/6.1) brief summary

    documentationUpdated Dec 5, 2024
  • #8496

    Constant time with AutoShape

    questionTODOUpdated Nov 3, 2024

> Tags

Pythoncomputer-visioncoremldeep-learningimage-classification

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言