<div align="center">
<p>
<a href="https://yolovision.ultralytics.com/" target="_blank">
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/im/banner-yolo-vision-2023.png"></a>
<!--
<a align="center" href="https://ultralytics.com/yolov5" target="_blank">
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov5/v70/splash.png"></a>
-->
</p>
[English](README.md) | [ç®ä½ä¸æ](README.zh-CN.md)
<br>
<div>
<a href="https://github.com/ultralytics/yolov5/actions/workflows/ci-testing.yml"><img src="https://github.com/ultralytics/yolov5/actions/workflows/ci-testing.yml/badge.svg" alt="YOLOv5 CI"></a>
<a href="https://zenodo.org/badge/latestdoi/264818686"><img src="https://zenodo.org/badge/264818686.svg" alt="YOLOv5 Citation"></a>
<a href="https://hub.docker.com/r/ultralytics/yolov5"><img src="https://img.shields.io/docker/pulls/ultralytics/yolov5?logo=docker" alt="Docker Pulls"></a>
<br>
<a href="https://bit.ly/yolov5-paperspace-notebook"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run on Gradient"></a>
<a href="https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
<a href="https://www.kaggle.com/ultralytics/yolov5"><img src="https://kaggle.com/static/images/open-in-kaggle.svg" alt="Open In Kaggle"></a>
</div>
<br>
YOLOv5 ð is the world's most loved vision AI, representing <a href="https://ultralytics.com">Ultralytics</a> open-source research into future vision AI methods, incorporating lessons learned and best practices evolved over thousands of hours of research and development.
We hope that the resources here will help you get the most out of YOLOv5. Please browse the YOLOv5 <a href="https://docs.ultralytics.com/yolov5">Docs</a> for details, raise an issue on <a href="https://github.com/ultralytics/yolov5/issues/new/choose">GitHub</a> for support, and join our <a href="https://ultralytics.com/discord">Discord</a> community for questions and discussions!
To request an Enterprise License please complete the form at [Ultralytics Licensing](https://ultralytics.com/license).
<div align="center">
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="2%" alt="Ultralytics GitHub"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="2%" alt="Ultralytics LinkedIn"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
<a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="2%" alt="Ultralytics Twitter"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
<a href="https://youtube.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="2%" alt="Ultralytics YouTube"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="2%" alt="Ultralytics TikTok"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
<a href="https://www.instagram.com/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="2%" alt="Ultralytics Instagram"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
<a href="https://ultralytics.com/discord"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="2%" alt="Ultralytics Discord"></a>
</div>
</div>
<br>
## <div align="center">YOLOv8 ð NEW</div>
We are thrilled to announce the launch of Ultralytics YOLOv8 ð, our NEW cutting-edge, state-of-the-art (SOTA) model released at **[https://github.com/ultralytics/ultralytics](https://github.com/ultralytics/ultralytics)**. YOLOv8 is designed to be fast, accurate, and easy to use, making it an excellent choice for a wide range of object detection, image segmentation and image classification tasks.
See the [YOLOv8 Docs](https://docs.ultralytics.com) for details and get started with:
[](https://badge.fury.io/py/ultralytics) [](https://pepy.tech/project/ultralytics)
```bash
pip install ultralytics
```
<div align="center">
<a href="https://ultralytics.com/yolov8" target="_blank">
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/yolo-comparison-plots.png"></a>
</div>
## <div align="center">Documentation</div>
See the [YOLOv5 Docs](https://docs.ultralytics.com/yolov5) for full documentation on training, testing and deployment. See below for quickstart examples.
<details open>
<summary>Install</summary>
Clone repo and install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a
[**Python>=3.8.0**](https://www.python.org/) environment, including
[**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
```bash
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
```
</details>
<details>
<summary>Inference</summary>
YOLOv5 [PyTorch Hub](https://docs.ultralytics.com/yolov5/tutorials/pytorch_hub_model_loading) inference. [Models](https://github.com/ultralytics/yolov5/tree/master/models) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases).
```python
import torch
# Model
model = torch.hub.load("ultralytics/yolov5", "yolov5s") # or yolov5n - yolov5x6, custom
# Images
img = "https://ultralytics.com/images/zidane.jpg" # or file, Path, PIL, OpenCV, numpy, list
# Inference
results = model(img)
# Results
results.print() # or .show(), .save(), .crop(), .pandas(), etc.
```
</details>
<details>
<summary>Inference with detect.py</summary>
`detect.py` runs inference on a variety of sources, downloading [models](https://github.com/ultralytics/yolov5/tree/master/models) automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases) and saving results to `runs/detect`.
```bash
python detect.py --weights yolov5s.pt --source 0 # webcam
img.jpg # image
vid.mp4 # video
screen # screenshot
path/ # directory
list.txt # list of images
list.streams # list of streams
'path/*.jpg' # glob
'https://youtu.be/LNwODJXcvt4' # YouTube
'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream
```
</details>
<details>
<summary>Training</summary>
The commands below reproduce YOLOv5 [COCO](https://github.com/ultralytics/yolov5/blob/master/data/scripts/get_coco.sh)
results. [Models](https://github.com/ultralytics/yolov5/tree/master/models)
and [datasets](https://github.com/ultralytics/yolov5/
yolov5的python代码
需积分: 0 18 浏览量
更新于2024-10-22
收藏 15.91MB ZIP 举报
YOLOv5是由Joseph Redmon等人首次提出的一系列实时目标检测算法中的最新版本。YOLO代表“You Only Look Once”,意味着算法可以一次性地处理图像,并直接在图像中预测边界框和类别概率。这种一次性处理方式极大地加快了目标检测的速度,同时保持了较高的准确率。
yolov5的Python代码是开源社区提供的实现,用于训练和执行基于YOLOv5的深度学习目标检测模型。代码通常包括数据预处理、模型定义、训练逻辑、结果评估以及模型导出和推理等关键部分。
在数据预处理方面,yolov5的代码需要准备一个符合格式要求的数据集,这些数据集通常被划分为训练集和验证集。数据集中的每张图片都与一个标注文件相对应,标注文件记录了图片中每个目标的位置和类别信息。为了提升模型的泛化能力,预处理步骤还可能包括图像增强,如随机裁剪、旋转、缩放和颜色变换等。
模型定义部分涉及到神经网络架构的设计,YOLOv5在不同版本中采用了不同的网络结构。yolov5的Python代码通常包含了多种不同的网络配置,以适应不同的应用场景和性能要求。例如,YOLOv5s、YOLOv5m、YOLOv5l和YOLOv5x分别代表不同的模型大小和计算复杂度,s是small的缩写,代表轻量级模型,而x是extra large的缩写,表示更大的模型。
训练逻辑包括设置学习率、优化器、损失函数等参数,并使用提供的数据集对模型进行训练。训练过程中,代码会自动计算损失并更新模型权重,直至达到预定的迭代次数或验证集的性能不再提升为止。yolov5的代码库还可能包括了梯度累积、自动混合精度训练等功能,这些都有助于加速训练过程并提升模型性能。
评估模型的性能是训练过程中的一个重要环节,通常使用验证集来计算各种指标,例如平均精度均值(mAP)和召回率等。这些指标能直观地反映模型在目标检测任务上的表现。
模型导出和推理部分使得训练好的模型可以用于实际应用,如视频监控、图像分析等。在推理时,模型将读取新的图像或视频流,识别并标记图像中的目标。yolov5的Python代码还可能支持将模型导出为其他平台或框架(如ONNX、TensorRT等)所兼容的格式,以便在不同的硬件或软件环境中部署。
在深度学习和人工智能领域,YOLOv5由于其快速和准确的特性,已经成为很多工业界和学术界人士研究和应用的目标检测解决方案之一。yolov5的Python代码的广泛流行也得益于其完善的文档和社区支持,方便开发者快速上手并实现自己的目标检测任务。
标签中的yolo代表了YOLO系列算法的统称,而yolov5特指这个系列中的第五代算法。Python作为当前最受欢迎的编程语言之一,在数据科学和机器学习领域具有不可替代的地位,yolov5的Python代码的出现,使得更多人能够轻松地使用这一先进的目标检测技术。

新兴AI民工
- 粉丝: 6447
最新资源
- 五章PLC的步进电机控制系统教程文件.ppt
- (完整版)工业网络技术.ppt
- Excel电子表格基本操.ppt
- CAD快捷键大全完整版(整理).pdf
- FPGA器件的开发平台与MATLAB接口仿真设计.doc
- c语言课程设计报告书.doc
- 别墅群项目管理策划书(工期586天).doc
- 强弱人工智能产品之法律地位再思考.docx
- 唯博网络营销解决方案-网络推广介绍-webpub创意设计工作室(1).doc
- 2015年度机电工程(主项)考试(网络继续教育)题目及答案.pdf
- 阿里巴巴菜鸟网络.pptx
- Flash编程基础言简意赅适合新人没有基础也能看懂啊.doc
- 南华大学《MATLAB及应用》实验报告1.doc
- 2022网络环境下对教育模式研究的开题报告.docx
- 通信专业实务考试试卷(初级)讲义资料.doc
- 东北大学2021年9月《热工仪表及自动化》作业考核试题及答案参考6.docx