Ultralytics YOLO27
YOLO27 模型正处于最终研发阶段,预计将于今年晚些时候发布。模型目前尚未推出,也没有确定发布日期。 本页面预览了即将推出的模型;在正式发布前,功能和基准测试结果可能会有所变化。以下代码示例旨在模型及其软件包支持发布后使用,当前公开的软件包无法运行这些示例。目前不会发布模型权重、配置和实现代码。加入 YOLO27 候补名单,以便第一时间获知发布消息。
概述#
Ultralytics YOLO27 是一系列实时视觉模型,其检测模型采用两种互补设计:紧凑型 N 和 S 模型采用精简的 CNN 架构,较大的 M 和 L 模型则采用基于查询且无需 NMS 的架构。两种设计都通过同一接口部署。N 和 S 检测模型默认使用带 NMS 的一对多预测头;使用 nms=False 可选择其无需 NMS 的预测头。
YOLO27 是 Ultralytics YOLO 系列中即将推出的模型系列,接替 YOLO26。该系列有四种 尺寸——N、S、M 和 L——并支持目标检测、 实例分割、语义分割、 深度估计、分类、 姿态估计和有向目标检测。双设计架构适用于 检测、实例分割和姿态估计。语义分割、深度估计、分类和有向目标检测则采用 CNN 架构。
在四种检测尺度下,YOLO27 在 COCO 上达到 42.6-60.5 mAP,在 NVIDIA RTX PRO 6000 上的延迟为 0.44-1.86 ms;使用更大的 800 像素输入时,YOLO27l 的 mAP 最高可达 61.4。YOLO27l 是首个在 COCO 上超过 60 mAP 的 Ultralytics 模型,而轻量版 YOLO27n/s 在速度基本相同的情况下,精度优于 YOLO26n/s。
from ultralytics import YOLO
model = YOLO("yolo27n.pt") # 加载预训练的 YOLO27n 模型
results = model("path/to/bus.jpg") # 运行推理主要功能#
-
双尺度检测 标准检测器会在三张特征图上预测对象——细粒度、中等粒度和粗粒度。YOLO27 N 和 S 去掉中等粒度特征图,只在细粒度特征图(用于小目标)和粗粒度特征图(用于大目标)上进行预测,并通过对融合特征进行固定缩放来保持两个尺度的平衡。这样可以大幅减少检测头的计算量,让模型运行得更快,同时保持与完整三尺度设计同样可靠的训练效果。
-
更强的小目标检测能力 较早的高分辨率特征阶段会加宽,以捕捉更多精细细节。结合保留下来的精细预测图,这能提升小目标的定位和回归效果——小目标是紧凑型模型最难处理的类别。
-
前景对齐监督 训练期间,一个额外的轻量级分支会学习在每个位置区分“目标”和“背景”。该分支旨在弥合训练中使用的更密集的一对多监督与生成最终预测的一对一检测头之间的差距——将 YOLO26n/s 上 0.9/0.8 mAP 的精度差距缩小到 YOLO27n/s 上仅 0.4 mAP,使部署后的一对一检测头保留几乎全部训练时的精度。该分支仅在训练期间使用,在推理和导出时会移除,因此不会增加部署成本。
-
基于查询的检测,无需 NMS 较大的模型使用一个 Transformer 解码器取代密集预测, 该解码器会优化一组固定的目标查询, 并直接输出最终检测结果——无需进行 非极大值抑制后处理。YOLO27m 和 YOLO27l 将该 解码器与 UltraViT 主干网络结合,在最深层使用 自注意力来捕获全局上下文, 后接 FPN/PAN 颈部网络。
-
统一简洁的接口 两种架构都通过同一个
YOLOPython 接口使用。系统会根据模型自动选择合适的训练、验证、预测和导出流程,因此,为某个 YOLO27 规模编写的代码也能直接用于其他规模。
我应该使用哪种 YOLO27?#
以下指南适用于 YOLO27 发布后如何选择模型。目前的项目请使用 YOLO26。
- YOLO27n / YOLO27s — 适用于边缘设备、无人机和实时视频:这是该系列中速度最快的模型,双尺度设计提升了小目标检测能力。有关特定设备的部署说明,请参阅 NVIDIA Jetson 和 Raspberry Pi。
- YOLO27m — 在 GPU 上实现精度与速度的理想平衡:在延迟相近的情况下,精度优于 YOLO26m,是生产环境中 GPU 部署的默认选择。
- YOLO27l — 适用于对精度要求极高的应用:首个在 COCO 上超过 60 mAP 的 Ultralytics 模型,使用更大的输入尺寸时 mAP 达到 61.4,同时在 GPU 上保持实时性能。
如需与其他系列进行比较,请查看所有 Ultralytics 模型。如需在自己的硬件上而非我们的硬件上测量精度与速度之间的权衡,请参阅 Benchmark 模式。
支持的任务和模式#
下表预览了计划在四种 YOLO27 模型规模中支持的任务和模式。勾选标记表示计划在发布时支持,并不代表当前已公开提供;表中列出的所有模型文件均尚未发布。
| 模型 | 文件名 | 任务 | 训练 | 验证 | 推理 | 导出 |
|---|---|---|---|---|---|---|
| YOLO27 | yolo27n.pt yolo27s.pt yolo27m.pt yolo27l.pt | 检测 | ✅ | ✅ | ✅ | ✅ |
| YOLO27-seg | yolo27n-seg.pt yolo27s-seg.pt yolo27m-seg.pt yolo27l-seg.pt | 实例分割 | ✅ | ✅ | ✅ | ✅ |
| YOLO27-sem | yolo27n-sem.pt yolo27s-sem.pt yolo27m-sem.pt yolo27l-sem.pt | 语义分割 | ✅ | ✅ | ✅ | ✅ |
| YOLO27-depth | yolo27n-depth.pt yolo27s-depth.pt yolo27m-depth.pt yolo27l-depth.pt | 深度估计 | ✅ | ✅ | ✅ | ✅ |
| YOLO27-cls | yolo27n-cls.pt yolo27s-cls.pt yolo27m-cls.pt yolo27l-cls.pt | 分类 | ✅ | ✅ | ✅ | ✅ |
| YOLO27-pose | yolo27n-pose.pt yolo27s-pose.pt yolo27m-pose.pt yolo27l-pose.pt | 姿态/关键点 | ✅ | ✅ | ✅ | ✅ |
| YOLO27-obb | yolo27n-obb.pt yolo27s-obb.pt yolo27m-obb.pt yolo27l-obb.pt | 定向检测 | ✅ | ✅ | ✅ | ✅ |
YOLO27 Detect、Segment、Pose 和 OBB 模型也支持 Track 模式,该模式基于 predict 运行,可跨视频帧进行多目标跟踪。
YOLO27 检测、实例分割和姿态估计在同一接口下采用两种设计:N 和 S 尺度 采用 CNN 架构,而 M 和 L 尺度采用基于查询且无需 NMS 的架构。语义分割、 深度估计、分类和有向目标检测采用 CNN 架构。
性能指标#
检测精度在 COCO 验证集上报告。有关 mAP、精确率和召回率的说明,请参阅 YOLO 性能指标。如需了解 COCO 之外的精度表现,请参阅 Ultralytics 基准测试,该基准测试衡量了跨越 37 个 真实世界检测数据集的宏平均 mAP50-95,涵盖医学影像、遥感、工业、零售等领域。推理速度是在 NVIDIA RTX PRO 6000 (TensorRT 11,FP16)上测得的 GPU 速度,以及在 AMD EPYC 9655(ONNX Runtime,FP32)上测得的 CPU 速度。发布后,可以使用 yolo val model=yolo27n.pt data=coco.yaml imgsz=640 nms=False save_json=True 复现精度数据。 检测、实例分割和姿态估计表格使用无需 NMS 的检测头和 COCO 评估。N/S 姿态 验证使用矩形批次(rect=True)。
这些研究结果可能会在最终研发过程中发生变化。发布时将同时提供公开权重和复现说明。
有关这些模型的使用示例,请参阅检测文档。这些模型在 COCO 上训练,包含 80 个预训练类别。表格使用 640 像素的输入尺寸;概览中还报告了 YOLO27l 在 800 像素下的结果。
| 模型 | 尺寸 (像素) | mAPval50-95 | 速度 CPU ONNX (毫秒) | 速度 RTX PRO 6000 TensorRT11 (毫秒) | 参数 (M) | FLOPs (B) |
|---|---|---|---|---|---|---|
| YOLO27n | 640 | 42.6 | 16.1 ± 1.6 | 0.44 ± 0.00 | 3.0 | 7.2 |
| YOLO27s | 640 | 50.1 | 33.2 ± 0.1 | 0.64 ± 0.00 | 11.8 | 28.2 |
| YOLO27m | 640 | 56.4 | 74.8 ± 0.5 | 1.01 ± 0.00 | 24.6 | 64.6 |
| YOLO27l | 640 | 60.5 | 149.6 ± 1.4 | 1.86 ± 0.00 | 72.3 | 166.7 |
参数量和 FLOPs 数值针对融合后的模型,融合过程包括 Conv/BatchNorm 折叠和移除未使用的检测分支。检测、实例分割和姿态测量会使用 nms=False 选择无需 NMS 的检测头;N/S 的精度取决于所选检测头。FLOPs 包含解码器注意力矩阵乘法。预训练检查点保留完整的训练架构,因此显示的计数可能更高。
使用示例#
本节提供简单的 YOLO27训练和推理示例。对于自定义数据集,请参阅获得最佳训练效果的技巧和超参数调优指南。
以下示例适用于 YOLO27 Detect 模型,用于目标检测。
你可以将预训练的 PyTorch *.pt 模型以及配置 *.yaml 文件传递给 YOLO() 类,以便在 Python 中创建模型实例:
from ultralytics import YOLO
# 加载一个经过 COCO 预训练的 YOLO27n 模型
model = YOLO("yolo27n.pt")
# 使用 YOLO27n 模型对“bus.jpg”图像进行推理
results = model("path/to/bus.jpg")
# 使用 COCO8 示例数据集训练模型 100 个 epoch
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)常见问题#
- 双尺度检测(N/S):移除中等尺度的预测特征图,采用更快的检测头,同时保持有竞争力的准确率
- 更强的小目标检测能力(N/S):加宽前期特征阶段,提升小目标定位效果
- 前景对齐监督(N/S):将一对多与一对一之间的准确率差距从 YOLO26n/s 上的 0.9/0.8 mAP 缩小到 YOLO27n/s 上的 0.4 mAP,且不增加推理开销
- 基于查询的无 NMS 检测(M/L):Transformer 解码器直接输出最终检测结果
- 统一的简洁接口:两种架构都通过相同的
YOLO类运行
暂时不要——YOLO27 尚未发布。目前的项目请继续使用 YOLO26。初步结果显示,各种模型尺寸的准确率都有所提升,其中 YOLO27l 在 COCO 上超过了 60 mAP。迁移前,请先使用最终发布的模型评估其在你的工作负载上的表现。
发布后,YOLO27 计划使用与 YOLO26 相同的
YOLO类,以及相同的 train/val/predict/export API——系统会根据模型自动选择合适的流水线(CNN 或基于查询的流水线)。待 YOLO27 支持和权重可用后,将yolo26n.pt替换为yolo27n.pt即可完成预期的模型选择变更。大多数检测器会在不同分辨率的三个特征图上进行预测。YOLO27 N 和 S 保留小目标所依赖的精细特征图,以及大型目标所需的粗略特征图,并跳过中间尺度的特征图。这显著减少了检测头的计算量,而前文所述的训练改进则让准确率与延迟之间的权衡仍具竞争力。
YOLO27l 是首个在 COCO 上超过 60 mAP 的 Ultralytics 模型,在 640 像素输入下达到 60.5 mAP(在 NVIDIA RTX PRO 6000 上为 1.9 ms),在 800 像素输入下达到 61.4 mAP(2.4 ms)。它结合了 UltraViT 主干网络、多尺度特征融合,以及一种基于查询的检测器,可直接生成最终检测结果,无需 NMS。
YOLO27 正在进行最后阶段的研发,预计于今年晚些时候发布。目前尚未确定发布日期。模型权重和实现代码尚未公开。
评论9
提出问题、分享结果,或帮助其他人。
sergshadrap
Guys! You are doing incredible job , The thing I'd asked for is the total size for running model. When we speak about small devices embedded solutions that the -n model is intended to the size is very limited by the SoC properties and that is though to predict if it fits to the board or not. I think pointing the size is also important along the performance metrics for tiny models. Thanks again!
Paula DerrengerUltralyticsThanks from the Ultralytics team and YOLO community—good suggestion. The preview lists
YOLO27nat 3.0M parameters, but actual storage and runtime memory depend on the export format, precision, input size, and backend; exact measurements cannot be published until the models are released. We’ll consider adding artifact-size and memory benchmarks to the YOLO27 documentation, and please keep sharing embedded-device requirements here for team visibility.sergshadrap
Thanks for you! Definitely nobody will ask about exact sizes of the models. What I meant is that most of the camera's SoCs ( for instance) we can split for three major segments, where the middle one is about Arm 1Ggz , 16m flash, and 128m Ram, the high is everything that has more advanced scu with multicores ,spaced flash and Ram and definitely folds more expensive and the low that everything below that. Trying to fit yolo26 to the gk7205v300 that exactly the middle one was a challenge even quantitized to 8. So ... what about the v27? Does it belong to the high-end only or I can try it for the middle one?
Paula DerrengerUltralyticsYOLO27nis intended for edge devices, so it is not high-end-only; its preliminary 3.0M parameters suggest INT8 weights around 3 MB, but 128 MB RAM may still be the limiting factor because activations and backend buffers depend on input size and runtime. For the GK7205V300, consider it a plausible target—not a confirmed fit—until the released model can be exported, profiled at reducedimgsz, and benchmarked on-device;YOLO27m/lare unlikely choices for those constraints. Please keep sharing your embedded results in this discussion so the Ultralytics team can track them alongside the YOLO27 documentation.
Mohammed YasinUltralytics@sergshadrap How's the performance of YOLO26 on such SoCs? Because if it's too big to fit the SoC, then isn't it also too heavy to run? You can always reduce the size of the YOLO models by modifying the YAML file and removing some layers or reducing channels.
sergshadrap
Yeah , that is quite heavy stuff for 1 core 0.9 Ghz SoC , but I have it run . The most stable and sensible (for object recognition) configuration turns to be fp16 288x384 nano , that goes about 0.8 fps in continues run . That's pretty slow , but enough for my current cascade version, where IVE hardware detector is catching "something" and yolo refine the output. Would be glad to get a hint - how to reduce size and reduce layers/ channels. Now I'm on ncnn export tools , so it seems there is no fp8 variant for that tool? Forth to mention I'm on OpenIpc firmware and the majestic additionally quite a leaky guy , so with 128M of memory for all we're on the floor..
Mohammed YasinUltralytics(已编辑)You can create a copy of this YAML and reduce the float values. Lowering width (the second float value) brings the biggest drop in model file size. Of course, all of these also reduces accuracy. The modified YAML can be loaded and used with
model = YOLO("path/to/yaml")The ending suffix letter like
ndetermines which of the scale values are used from this YAML.sergshadrap
If only I change the model , do I need to re-train the model completely or I could move the weights from existing with some algorithm?
Mohammed YasinUltralyticsYou have to retrain since model structure changes when you do this