跳至内容

How to Export to PaddlePaddle Format from YOLO11 Models

Bridging the gap between developing and deploying computer vision models in real-world scenarios with varying conditions can be difficult. PaddlePaddle makes this process easier with its focus on flexibility, performance, and its capability for parallel processing in distributed environments. This means you can use your YOLO11 computer vision models on a wide variety of devices and platforms, from smartphones to cloud-based servers.



观看: How to Export Ultralytics YOLO11 Models to PaddlePaddle Format | Key Features of PaddlePaddle Format

The ability to export to PaddlePaddle model format allows you to optimize your Ultralytics YOLO11 models for use within the PaddlePaddle framework. PaddlePaddle is known for facilitating industrial deployments and is a good choice for deploying computer vision applications in real-world settings across various domains.

为什么要导出到PaddlePaddle ?

PaddlePaddle 标志

Developed by Baidu, PaddlePaddle (PArallel Distributed Deep LEarning) is China's first open-source deep learning platform. Unlike some frameworks built mainly for research, PaddlePaddle prioritizes ease of use and smooth integration across industries.

It offers tools and resources similar to popular frameworks like TensorFlow and PyTorch, making it accessible for developers of all experience levels. From farming and factories to service businesses, PaddlePaddle's large developer community of over 4.77 million is helping create and deploy AI applications.

By exporting your Ultralytics YOLO11 models to PaddlePaddle format, you can tap into PaddlePaddle's strengths in performance optimization. PaddlePaddle prioritizes efficient model execution and reduced memory usage. As a result, your YOLO11 models can potentially achieve even better performance, delivering top-notch results in practical scenarios.

PaddlePaddle 机型的主要特点

PaddlePaddle 这些模型提供了一系列关键功能,有助于在各种部署方案中提高灵活性、性能和可扩展性:

  • 动态到静态图:PaddlePaddle 支持动态到静态编译,可将模型转化为静态计算图。这样可以进行优化,减少运行时开销,提高推理性能。

  • 算子融合:PaddlePaddle与TensorRT 一样,使用运算符融合来简化计算和减少开销。该框架通过合并兼容操作,最大限度地减少内存传输和计算步骤,从而加快推理速度。

  • 量化:PaddlePaddle 支持量化技术,包括训练后量化和量化感知训练。这些技术允许使用较低精度的数据表示,从而有效提高性能并缩小模型尺寸。

中的部署选项PaddlePaddle

Before diving into the code for exporting YOLO11 models to PaddlePaddle, let's take a look at the different deployment scenarios in which PaddlePaddle models excel.

PaddlePaddle 提供了一系列选项,每种选项都在易用性、灵活性和性能方面取得了明显的平衡:

  • Paddle Serving:该框架简化了PaddlePaddle 模型作为高性能 RESTful API 的部署。Paddle Serving 是生产环境的理想选择,具有模型版本化、在线 A/B 测试和处理大量请求的可扩展性等功能。

  • Paddle Inference API:桨式推理应用程序接口(Paddle Inference API)可让您对模型的执行进行底层控制。该选项非常适合需要将模型紧密集成到自定义应用程序或针对特定硬件优化性能的情况。

  • Paddle Lite:Paddle Lite 专为在资源有限的移动和嵌入式设备上部署而设计。它对模型进行了优化,以便在 ARM CPU、GPU 和其他专用硬件上实现更小的尺寸和更快的推理。

  • Paddle.jsPaddle.js 使您能够在网络浏览器中直接部署PaddlePaddle 模型。Paddle.js 既可以加载预训练模型,也可以使用 Paddle.js 提供的模型转换工具从paddle-hub转换模型。它可以在支持 WebGL/WebGPU/WebAssembly 的浏览器中运行。

Export to PaddlePaddle: Converting Your YOLO11 Model

Converting YOLO11 models to the PaddlePaddle format can improve execution flexibility and optimize performance for various deployment scenarios.

安装

要安装所需的软件包,请运行

安装

# Install the required package for YOLO11
pip install ultralytics

For detailed instructions and best practices related to the installation process, check our Ultralytics Installation guide. While installing the required packages for YOLO11, if you encounter any difficulties, consult our Common Issues guide for solutions and tips.

使用方法

Before diving into the usage instructions, it's important to note that while all Ultralytics YOLO11 models are available for exporting, you can ensure that the model you select supports export functionality here.

使用方法

from ultralytics import YOLO

# Load the YOLO11 model
model = YOLO("yolo11n.pt")

# Export the model to PaddlePaddle format
model.export(format="paddle")  # creates '/yolo11n_paddle_model'

# Load the exported PaddlePaddle model
paddle_model = YOLO("./yolo11n_paddle_model")

# Run inference
results = paddle_model("https://ultralytics.com/images/bus.jpg")
# Export a YOLO11n PyTorch model to PaddlePaddle format
yolo export model=yolo11n.pt format=paddle  # creates '/yolo11n_paddle_model'

# Run inference with the exported model
yolo predict model='./yolo11n_paddle_model' source='https://ultralytics.com/images/bus.jpg'

有关支持的导出选项的详细信息,请访问Ultralytics 部署选项文档页面

Deploying Exported YOLO11 PaddlePaddle Models

After successfully exporting your Ultralytics YOLO11 models to PaddlePaddle format, you can now deploy them. The primary and recommended first step for running a PaddlePaddle model is to use the YOLO("./model_paddle_model") method, as outlined in the previous usage code snippet.

不过,有关在其他各种环境中部署PaddlePaddle 模型的深入说明,请参阅以下资源:

  • 桨仕:了解如何使用 Paddle Serving 将PaddlePaddle 模型部署为高性能服务。

  • 轻便桨:探索如何使用 Paddle Lite 在移动和嵌入式设备上优化和部署模型。

  • Paddle.js:了解如何使用 Paddle.js 在网页浏览器中运行PaddlePaddle 模型,以实现客户端人工智能。

摘要

In this guide, we explored the process of exporting Ultralytics YOLO11 models to the PaddlePaddle format. By following these steps, you can leverage PaddlePaddle's strengths in diverse deployment scenarios, optimizing your models for different hardware and software environments.

有关使用的详细信息,请访问PaddlePaddle 官方文档

Want to explore more ways to integrate your Ultralytics YOLO11 models? Our integration guide page explores various options, equipping you with valuable resources and insights.

常见问题

How do I export Ultralytics YOLO11 models to PaddlePaddle format?

Exporting Ultralytics YOLO11 models to PaddlePaddle format is straightforward. You can use the export YOLO 方法来执行导出。下面是一个使用Python 的示例:

使用方法

from ultralytics import YOLO

# Load the YOLO11 model
model = YOLO("yolo11n.pt")

# Export the model to PaddlePaddle format
model.export(format="paddle")  # creates '/yolo11n_paddle_model'

# Load the exported PaddlePaddle model
paddle_model = YOLO("./yolo11n_paddle_model")

# Run inference
results = paddle_model("https://ultralytics.com/images/bus.jpg")
# Export a YOLO11n PyTorch model to PaddlePaddle format
yolo export model=yolo11n.pt format=paddle  # creates '/yolo11n_paddle_model'

# Run inference with the exported model
yolo predict model='./yolo11n_paddle_model' source='https://ultralytics.com/images/bus.jpg'

有关更详细的设置和故障排除,请查阅Ultralytics 安装指南常见问题指南

What are the advantages of using PaddlePaddle for model deployment?

PaddlePaddle 为模型部署提供了几个关键优势:

  • 性能优化:PaddlePaddle 在高效执行模型和减少内存使用方面表现出色。
  • 动态到静态的图形编译:它支持动态到静态的编译,允许运行时优化。
  • 操作符融合:通过合并兼容操作,可减少计算开销。
  • Quantization Techniques: Supports both post-training and quantization-aware training, enabling lower-precision data representations for improved performance.

You can achieve enhanced results by exporting your Ultralytics YOLO11 models to PaddlePaddle, ensuring flexibility and high performance across various applications and hardware platforms. Learn more about PaddlePaddle's features here.

Why should I choose PaddlePaddle for deploying my YOLO11 models?

PaddlePaddle, developed by Baidu, is optimized for industrial and commercial AI deployments. Its large developer community and robust framework provide extensive tools similar to TensorFlow and PyTorch. By exporting your YOLO11 models to PaddlePaddle, you leverage:

  • 增强性能:最佳执行速度,减少内存占用。
  • 灵活性:广泛兼容从智能手机到云服务器的各种设备。
  • 可扩展性:为分布式环境提供高效的并行处理能力。

These features make PaddlePaddle a compelling choice for deploying YOLO11 models in production settings.

与其他框架相比,PaddlePaddle 如何提高模型性能?

PaddlePaddle 采用多种先进技术来优化模型性能:

  • 动态到静态图:将模型转换为静态计算图,用于运行时优化。
  • 操作符融合:结合兼容操作,最大限度地减少内存传输,提高推理速度。
  • Quantization: Reduces model size and increases efficiency using lower-precision data while maintaining accuracy.

These techniques prioritize efficient model execution, making PaddlePaddle an excellent option for deploying high-performance YOLO11 models. For more on optimization, see the PaddlePaddle official documentation.

What deployment options does PaddlePaddle offer for YOLO11 models?

PaddlePaddle 提供灵活的部署选项:

  • 桨式服务:以 RESTful API 的形式部署模型,具有模型版本管理和在线 A/B 测试等功能,是生产的理想选择。
  • 桨式推理应用程序接口:为定制应用程序提供对模型执行的底层控制。
  • Paddle Lite:针对移动和嵌入式设备的有限资源优化模型。
  • Paddle.js:可在网络浏览器中直接部署模型。

这些选项涵盖了从设备推断到可扩展云服务等多种部署方案。在Ultralytics Model 部署选项页面上探索更多部署策略。


📅 Created 7 months ago ✏️ Updated 12 days ago

评论