跳至内容

YOLO-NAS

概述

Developed by Deci AI, YOLO-NAS is a groundbreaking object detection foundational model. It is the product of advanced Neural Architecture Search technology, meticulously designed to address the limitations of previous YOLO models. With significant improvements in quantization support and accuracy-latency trade-offs, YOLO-NAS represents a major leap in object detection.

模型示例图片 YOLO-NAS概览。 YOLO-NAS采用了量化感知块和选择性量化技术,以获得最佳性能。该模型在转换为 INT8 量化版本时,精度下降极小,比其他模型有显著提高。这些进步最终形成了一个卓越的架构,具有前所未有的目标检测能力和出色的性能。

主要功能

  • 便于量化的基本模块: YOLO-NAS 引入了便于量化的新基本模块,解决了以往YOLO 模型的一个重大局限。
  • 先进的训练和量化: YOLO-NAS 利用先进的训练方案和训练后量化来提高性能。
  • AutoNAC 优化和预训练: YOLO-NAS 采用了 AutoNAC 优化技术,并在 COCO、Objects365 和Roboflow 100 等著名数据集上进行了预训练。这种预训练使其非常适合生产环境中的下游对象检测任务。

预训练模型

使用Ultralytics 提供的预训练YOLO-NAS 模型,体验下一代物体检测的强大功能。这些模型旨在提供一流的速度和精度性能。您可以根据自己的具体需求从各种选项中进行选择:

模型mAP延迟(毫秒)
YOLO-NAS S47.53.21
YOLO--NAS M51.555.85
YOLO-LAS52.227.87
YOLO-NAS S INT-847.032.36
YOLO-NAS M INT-851.03.78
YOLO-NAS L INT-852.14.78

Each model variant is designed to offer a balance between Mean Average Precision (mAP) and latency, helping you optimize your object detection tasks for both performance and speed.

使用示例

Ultralytics YOLO Python -NAS 型号可通过我们的 ultralytics python 软件包。该软件包提供了用户友好的Python API,以简化流程。

下面的示例展示了如何使用YOLO-NAS 模型与 ultralytics 用于推理和验证的软件包:

推理和验证示例

在本例中,我们在 COCO8 数据集上验证了YOLO-NAS-s。

示例

本例为YOLO-NAS 提供了简单的推断和验证代码。有关推理结果的处理,请参见 预测 模式。有关在其他模式下使用YOLO-NAS,请参阅 瓦尔出口.YOLO-NAS上的 ultralytics 软件包不支持培训。

PyTorch pretrained *.pt 模型文件可以传递给 NAS() 类在python 中创建模型实例:

from ultralytics import NAS

# Load a COCO-pretrained YOLO-NAS-s model
model = NAS("yolo_nas_s.pt")

# Display model information (optional)
model.info()

# Validate the model on the COCO8 example dataset
results = model.val(data="coco8.yaml")

# Run inference with the YOLO-NAS-s model on the 'bus.jpg' image
results = model("path/to/bus.jpg")

CLI 命令可直接运行模型:

# Load a COCO-pretrained YOLO-NAS-s model and validate it's performance on the COCO8 example dataset
yolo val model=yolo_nas_s.pt data=coco8.yaml

# Load a COCO-pretrained YOLO-NAS-s model and run inference on the 'bus.jpg' image
yolo predict model=yolo_nas_s.pt source=path/to/bus.jpg

支持的任务和模式

我们提供三种型号的YOLO-NAS:小型 (s)、中型 (m) 和大型 (l)。每种型号都能满足不同的计算和性能需求:

  • YOLO-NAS-s:针对计算资源有限但效率至关重要的环境进行了优化。
  • YOLO-NAS-m: Offers a balanced approach, suitable for general-purpose object detection with higher accuracy.
  • YOLO-NAS-l:专为要求最高精确度的场景定制,在这些场景中,计算资源的限制较少。

下面是每个模型的详细概述,包括预训练权重的链接、支持的任务以及与不同运行模式的兼容性。

型号预训练重量支持的任务推论验证培训出口
YOLO-NAS-syolo_nas_s.pt物体检测
YOLO-NAS-myolo_nas_m.pt物体检测
YOLO-NAS-lyolo_nas_l.pt物体检测

引文和致谢

如果您在研究或开发工作中使用YOLO-NAS,请引用 SuperGradients:

@misc{supergradients,
      doi = {10.5281/ZENODO.7789328},
      url = {https://zenodo.org/record/7789328},
      author = {Aharon,  Shay and {Louis-Dupont} and {Ofri Masad} and Yurkova,  Kate and {Lotem Fridman} and {Lkdci} and Khvedchenya,  Eugene and Rubin,  Ran and Bagrov,  Natan and Tymchenko,  Borys and Keren,  Tomer and Zhilko,  Alexander and {Eran-Deci}},
      title = {Super-Gradients},
      publisher = {GitHub},
      journal = {GitHub repository},
      year = {2021},
}

We express our gratitude to Deci AI's SuperGradients team for their efforts in creating and maintaining this valuable resource for the computer vision community. We believe YOLO-NAS, with its innovative architecture and superior object detection capabilities, will become a critical tool for developers and researchers alike.

常见问题

YOLO-NAS是什么,与以前的YOLO 型号相比有何改进?

YOLO-NAS由Deci AI 开发,是一种利用先进的神经架构搜索(NAS)技术的先进物体检测模型。它通过引入量化友好的基本模块和复杂的训练方案等功能,解决了以往YOLO 模型的局限性。这大大提高了性能,尤其是在计算资源有限的环境中。YOLO-NAS 还支持量化,即使转换为 INT8 版本也能保持高精度,从而增强了其在生产环境中的适用性。更多详情,请参阅概述部分。

如何将YOLO-NAS 模型集成到Python 应用程序中?

您可以使用以下工具轻松地将YOLO-NAS 模型集成到您的Python 应用程序中 ultralytics 软件包。下面是一个如何加载预训练的YOLO-NAS 模型并执行推理的简单示例:

from ultralytics import NAS

# Load a COCO-pretrained YOLO-NAS-s model
model = NAS("yolo_nas_s.pt")

# Validate the model on the COCO8 example dataset
results = model.val(data="coco8.yaml")

# Run inference with the YOLO-NAS-s model on the 'bus.jpg' image
results = model("path/to/bus.jpg")

更多信息,请参阅推理和验证示例

YOLO-NAS 有哪些主要功能,为什么要考虑使用它?

YOLO-NAS引入了几项关键功能,使其成为物体检测任务的最佳选择:

  • Quantization-Friendly Basic Block: Enhanced architecture that improves model performance with minimal precision drop post quantization.
  • 先进的训练和量化技术:采用先进的训练方案和训练后量化技术。
  • AutoNAC Optimization and Pre-training: Utilizes AutoNAC optimization and is pre-trained on prominent datasets like COCO, Objects365, and Roboflow 100. These features contribute to its high accuracy, efficient performance, and suitability for deployment in production environments. Learn more in the Key Features section.

YOLO-NAS 型号支持哪些任务和模式?

YOLO-NAS 模型支持各种目标检测任务和模式,如推理、验证和输出。它们不支持训练。支持的模型包括YOLO-NAS-s、YOLO-NAS-m 和YOLO-NAS-l,每种模型都针对不同的计算能力和性能需求而定制。有关详细概述,请参阅 "支持的任务和模式"部分。

是否有预先训练好的YOLO-NAS 模型,如何获取?

是的,Ultralytics 提供预训练的YOLO-NAS 模型,您可以直接访问。这些模型是在 COCO 等数据集上预先训练的,可确保在速度和准确性方面的高性能。您可以使用预训练模型部分提供的链接下载这些模型。下面是一些示例:

📅 Created 11 months ago ✏️ Updated 28 days ago

评论