콘텐츠로 건너뛰기

How to Export to NCNN from YOLO11 for Smooth Deployment

Deploying computer vision models on devices with limited computational power, such as mobile or embedded systems, can be tricky. You need to make sure you use a format optimized for optimal performance. This makes sure that even devices with limited processing power can handle advanced computer vision tasks well.

The export to NCNN format feature allows you to optimize your Ultralytics YOLO11 models for lightweight device-based applications. In this guide, we'll walk you through how to convert your models to the NCNN format, making it easier for your models to perform well on various mobile and embedded devices.

NCNN 으로 내보내야 하는 이유는 무엇인가요?

NCNN 개요

The NCNN framework, developed by Tencent, is a high-performance neural network inference computing framework optimized specifically for mobile platforms, including mobile phones, embedded devices, and IoT devices. NCNN is compatible with a wide range of platforms, including Linux, Android, iOS, and macOS.

NCNN is known for its fast processing speed on mobile CPUs and enables rapid deployment of deep learning models to mobile platforms. This makes it easier to build smart apps, putting the power of AI right at your fingertips.

NCNN 모델의 주요 기능

NCNN models offer a wide range of key features that enable on-device machine learning by helping developers run their models on mobile, embedded, and edge devices:

  • Efficient and High-Performance: NCNN models are made to be efficient and lightweight, optimized for running on mobile and embedded devices like Raspberry Pi with limited resources. They can also achieve high performance with high accuracy on various computer vision-based tasks.

  • Quantization: NCNN models often support quantization which is a technique that reduces the precision of the model's weights and activations. This leads to further improvements in performance and reduces memory footprint.

  • 호환성: NCNN 모델은 다음과 같이 널리 사용되는 딥 러닝 프레임워크와 호환됩니다. TensorFlow, CaffeONNX. 이러한 호환성 덕분에 개발자는 기존 모델과 워크플로를 쉽게 사용할 수 있습니다.

  • 사용 편의성: NCNN 모델은 널리 사용되는 딥 러닝 프레임워크와의 호환성 덕분에 다양한 애플리케이션에 쉽게 통합할 수 있도록 설계되었습니다. 또한 NCNN 에서는 다양한 형식 간의 모델 변환을 위한 사용자 친화적인 도구를 제공하여 개발 환경 전반에서 원활한 상호 운용성을 보장합니다.

배포 옵션 NCNN

Before we look at the code for exporting YOLO11 models to the NCNN format, let's understand how NCNN models are normally used.

NCNN 효율성과 성능을 위해 설계된 모델은 다양한 배포 플랫폼과 호환됩니다:

  • 모바일 배포: Android 및 iOS 에 특별히 최적화되어 효율적인 온디바이스 추론을 위해 모바일 애플리케이션에 원활하게 통합할 수 있습니다.

  • 임베디드 시스템 및 IoT 디바이스: Ultralytics 가이드를 사용하여 라즈베리 파이에서 추론을 실행하는 것이 충분히 빠르지 않다면 NCNN 내보내기 모델로 전환하면 속도를 높일 수 있습니다. NCNN 는 특히 장치에서 바로 빠른 처리가 필요한 상황에서 라즈베리 파이 및 NVIDIA Jetson과 같은 장치에 유용합니다.

  • 데스크톱 및 서버 배포: Linux, Windows, macOS의 데스크톱 및 서버 환경에 배포할 수 있으며, 더 높은 연산 능력으로 개발, 교육 및 평가를 지원합니다.

Export to NCNN: Converting Your YOLO11 Model

You can expand model compatibility and deployment flexibility by converting YOLO11 models to NCNN format.

설치

필요한 패키지를 설치하려면 실행합니다:

설치

# 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 NCNN format
model.export(format="ncnn")  # creates '/yolo11n_ncnn_model'

# Load the exported NCNN model
ncnn_model = YOLO("./yolo11n_ncnn_model")

# Run inference
results = ncnn_model("https://ultralytics.com/images/bus.jpg")
# Export a YOLO11n PyTorch model to NCNN format
yolo export model=yolo11n.pt format=ncnn  # creates '/yolo11n_ncnn_model'

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

지원되는 내보내기 옵션에 대한 자세한 내용은 배포 옵션에 대한Ultralytics 문서 페이지를 참조하세요.

Deploying Exported YOLO11 NCNN Models

After successfully exporting your Ultralytics YOLO11 models to NCNN format, you can now deploy them. The primary and recommended first step for running a NCNN model is to utilize the YOLO("./model_ncnn_model") method, as outlined in the previous usage code snippet. However, for in-depth instructions on deploying your NCNN models in various other settings, take a look at the following resources:

  • Android: This blog explains how to use NCNN models for performing tasks like object detection through Android applications.

  • macOS: macOS를 통해 작업을 수행하기 위해 NCNN 모델을 사용하는 방법을 이해합니다.

  • Linux: 이 페이지를 살펴보고 라즈베리 파이 및 기타 유사한 장치와 같은 제한된 리소스 장치에 NCNN 모델을 배포하는 방법을 알아보세요.

  • VS2017을 사용하는 Windows x64: 이 블로그를 살펴보고 Visual Studio Community 2017을 사용하여 Windows x64에 NCNN 모델을 배포하는 방법을 알아보세요.

요약

In this guide, we've gone over exporting Ultralytics YOLO11 models to the NCNN format. This conversion step is crucial for improving the efficiency and speed of YOLO11 models, making them more effective and suitable for limited-resource computing environments.

사용법에 대한 자세한 지침은 공식 문서( NCNN )를 참조하세요.

Also, if you're interested in exploring other integration options for Ultralytics YOLO11, be sure to visit our integration guide page for further insights and information.

자주 묻는 질문

How do I export Ultralytics YOLO11 models to NCNN format?

To export your Ultralytics YOLO11 model to NCNN format, follow these steps:

  • Python: 사용 export 함수를 YOLO 클래스에서 호출합니다.

    from ultralytics import YOLO
    
    # Load the YOLO11 model
    model = YOLO("yolo11n.pt")
    
    # Export to NCNN format
    model.export(format="ncnn")  # creates '/yolo11n_ncnn_model'
    
  • CLI: 사용 yolo 명령과 함께 export 인수입니다.

    yolo export model=yolo11n.pt format=ncnn  # creates '/yolo11n_ncnn_model'
    

자세한 내보내기 옵션은 문서에서 내보내기 페이지를 확인하세요.

What are the advantages of exporting YOLO11 models to NCNN?

Exporting your Ultralytics YOLO11 models to NCNN offers several benefits:

  • 효율성: NCNN 모델은 모바일 및 임베디드 디바이스에 최적화되어 있어 제한된 컴퓨팅 리소스로도 높은 성능을 보장합니다.
  • 양자화: NCNN 모델 속도를 개선하고 메모리 사용량을 줄이는 양자화와 같은 기술을 지원합니다.
  • 폭넓은 호환성: Android , iOS, Linux, macOS 등 여러 플랫폼에 NCNN 모델을 배포할 수 있습니다.

자세한 내용은 문서에서 NCNN 으로 내보내기 섹션을 참조하세요.

모바일 AI 애플리케이션에 NCNN 을 사용해야 하는 이유는 무엇인가요?

NCNN는 텐센트에서 개발한 앱으로 모바일 플랫폼에 최적화되어 있습니다. NCNN 을 사용해야 하는 주요 이유는 다음과 같습니다:

  • 고성능: 모바일 CPU에서 효율적이고 빠른 처리를 위해 설계되었습니다.
  • Cross-Platform: Compatible with popular frameworks such as TensorFlow and ONNX, making it easier to convert and deploy models across different platforms.
  • 커뮤니티 지원: 활발한 커뮤니티 지원으로 지속적인 개선과 업데이트를 보장합니다.

자세한 내용은 문서에서 NCNN 개요를 참조하세요.

What platforms are supported for NCNN model deployment?

NCNN 는 다목적이며 다양한 플랫폼을 지원합니다:

  • Mobile: Android, iOS.
  • 임베디드 시스템 및 IoT 장치: 라즈베리 파이 및 NVIDIA Jetson과 같은 장치.
  • 데스크톱 및 서버: Linux, Windows 및 macOS.

라즈베리 파이에서 모델을 실행하는 것이 충분히 빠르지 않은 경우, 라즈베리 파이 가이드에 자세히 설명된 대로 NCNN 형식으로 변환하면 속도를 높일 수 있습니다.

How can I deploy Ultralytics YOLO11 NCNN models on Android?

To deploy your YOLO11 models on Android:

  1. Android빌드: NCNN Android 용 빌드 가이드를 따르세요.
  2. 앱과 통합하기: NCNN Android SDK를 사용하여 내보낸 모델을 애플리케이션에 통합하면 효율적인 온디바이스 추론이 가능합니다.

For step-by-step instructions, refer to our guide on Deploying YOLO11 NCNN Models.

고급 가이드와 사용 사례는 Ultralytics 문서 페이지를 참조하세요.

📅 Created 7 months ago ✏️ Updated 22 days ago

댓글