Zum Inhalt springen

Learn to Export to TFLite Edge TPU Format From YOLO11 Model

Der Einsatz von Computer-Vision-Modellen auf Geräten mit begrenzter Rechenleistung, wie mobilen oder eingebetteten Systemen, kann schwierig sein. Die Verwendung eines Modellformats, das für schnellere Leistung optimiert ist, vereinfacht diesen Prozess. Das Modellformat TensorFlow Lite Edge TPU oder TFLite Edge TPU wurde entwickelt, um möglichst wenig Strom zu verbrauchen und gleichzeitig eine schnelle Leistung für neuronale Netze zu liefern.

The export to TFLite Edge TPU format feature allows you to optimize your Ultralytics YOLO11 models for high-speed and low-power inferencing. In this guide, we'll walk you through converting your models to the TFLite Edge TPU format, making it easier for your models to perform well on various mobile and embedded devices.

Warum solltest du nach TFLite Edge TPU exportieren?

Exporting models to TensorFlow Edge TPU makes machine learning tasks fast and efficient. This technology suits applications with limited power, computing resources, and connectivity. The Edge TPU is a hardware accelerator by Google. It speeds up TensorFlow Lite models on edge devices. The image below shows an example of the process involved.

TFLite Edge TPU

The Edge TPU works with quantized models. Quantization makes models smaller and faster without losing much accuracy. It is ideal for the limited resources of edge computing, allowing applications to respond quickly by reducing latency and allowing for quick data processing locally, without cloud dependency. Local processing also keeps user data private and secure since it's not sent to a remote server.

Die wichtigsten Merkmale von TFLite Edge TPU

Hier sind die wichtigsten Merkmale, die TFLite Edge TPU zu einem großartigen Modellformat für Entwickler machen:

  • Optimierte Leistung auf Edge-Geräten: Der TFLite Edge TPU erreicht durch Quantisierung, Modelloptimierung, Hardware-Beschleunigung und Compiler-Optimierung eine hohe Leistung für neuronale Netzwerke. Seine minimalistische Architektur trägt zu seiner geringen Größe und Kosteneffizienz bei.

  • Hoher Rechendurchsatz: TFLite Edge TPU kombiniert spezielle Hardware-Beschleunigung und effiziente Laufzeitausführung, um einen hohen Rechendurchsatz zu erzielen. Es eignet sich gut für den Einsatz von Machine-Learning-Modellen mit strengen Leistungsanforderungen auf Edge-Geräten.

  • Efficient Matrix Computations: The TensorFlow Edge TPU is optimized for matrix operations, which are crucial for neural network computations. This efficiency is key in machine learning models, particularly those requiring numerous and complex matrix multiplications and transformations.

Bereitstellungsoptionen mit TFLite Edge TPU

Before we jump into how to export YOLO11 models to the TFLite Edge TPU format, let's understand where TFLite Edge TPU models are usually used.

TFLite Edge TPU bietet verschiedene Einsatzmöglichkeiten für maschinelle Lernmodelle, darunter:

  • Einsatz auf dem Gerät: TensorFlow Die Modelle von Edge TPU können direkt auf mobilen und eingebetteten Geräten eingesetzt werden. Durch den Einsatz auf dem Gerät können die Modelle direkt auf der Hardware ausgeführt werden, ohne dass eine Cloud-Verbindung erforderlich ist.

  • Edge Computing mit Cloud TensorFlow TPUs: In Szenarien, in denen Edge-Geräte nur begrenzte Verarbeitungskapazitäten haben, können TensorFlow Edge TPUs Inferenzaufgaben auf Cloud-Server mit TPUs verlagern.

  • Hybrid Deployment: A hybrid approach combines on-device and cloud deployment and offers a versatile and scalable solution for deploying machine learning models. Advantages include on-device processing for quick responses and cloud computing for more complex computations.

Exporting YOLO11 Models to TFLite Edge TPU

You can expand model compatibility and deployment flexibility by converting YOLO11 models to TensorFlow Edge TPU.

Installation

Um das benötigte Paket zu installieren, führe es aus:

Installation

# 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.

Verwendung

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.

Verwendung

from ultralytics import YOLO

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

# Export the model to TFLite Edge TPU format
model.export(format="edgetpu")  # creates 'yolo11n_full_integer_quant_edgetpu.tflite'

# Load the exported TFLite Edge TPU model
edgetpu_model = YOLO("yolo11n_full_integer_quant_edgetpu.tflite")

# Run inference
results = edgetpu_model("https://ultralytics.com/images/bus.jpg")
# Export a YOLO11n PyTorch model to TFLite Edge TPU format
yolo export model=yolo11n.pt format=edgetpu  # creates 'yolo11n_full_integer_quant_edgetpu.tflite'

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

Weitere Details zu den unterstützten Exportoptionen findest du auf der Ultralytics Dokumentationsseite zu den Bereitstellungsoptionen.

Deploying Exported YOLO11 TFLite Edge TPU Models

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

Ausführliche Anleitungen für den Einsatz deiner TFLite Edge TPU Modelle findest du in den folgenden Ressourcen:

Zusammenfassung

In this guide, we've learned how to export Ultralytics YOLO11 models to TFLite Edge TPU format. By following the steps mentioned above, you can increase the speed and power of your computer vision applications.

Weitere Informationen zur Nutzung findest du auf der offiziellen Website von Edge TPU .

Also, for more information on other Ultralytics YOLO11 integrations, please visit our integration guide page. There, you'll discover valuable resources and insights.

FAQ

How do I export a YOLO11 model to TFLite Edge TPU format?

To export a YOLO11 model to TFLite Edge TPU format, you can follow these steps:

Verwendung

from ultralytics import YOLO

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

# Export the model to TFLite Edge TPU format
model.export(format="edgetpu")  # creates 'yolo11n_full_integer_quant_edgetpu.tflite'

# Load the exported TFLite Edge TPU model
edgetpu_model = YOLO("yolo11n_full_integer_quant_edgetpu.tflite")

# Run inference
results = edgetpu_model("https://ultralytics.com/images/bus.jpg")
# Export a YOLO11n PyTorch model to TFLite Edge TPU format
yolo export model=yolo11n.pt format=edgetpu  # creates 'yolo11n_full_integer_quant_edgetpu.tflite'

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

Ausführliche Informationen zum Exportieren von Modellen in andere Formate findest du in unserer Exportanleitung.

What are the benefits of exporting YOLO11 models to TFLite Edge TPU?

Exporting YOLO11 models to TFLite Edge TPU offers several benefits:

  • Optimierte Leistung: Erreiche eine hohe Leistung des neuronalen Netzwerks bei minimalem Stromverbrauch.
  • Geringere Latenzzeit: Schnelle lokale Datenverarbeitung ohne die Notwendigkeit einer Cloud-Abhängigkeit.
  • Verbesserter Datenschutz: Durch die lokale Verarbeitung bleiben die Nutzerdaten privat und sicher.

This makes it ideal for applications in edge computing, where devices have limited power and computational resources. Learn more about why you should export.

Kann ich die TFLite Edge TPU Modelle auf mobilen und eingebetteten Geräten einsetzen?

Ja, TensorFlow Lite Edge TPU Modelle können direkt auf mobilen und eingebetteten Geräten eingesetzt werden. Mit diesem Ansatz können die Modelle direkt auf der Hardware ausgeführt werden, was eine schnellere und effizientere Inferenzierung ermöglicht. Beispiele für die Integration findest du in unserem Leitfaden für den Einsatz von Coral Edge TPU auf dem Raspberry Pi.

Was sind die häufigsten Anwendungsfälle für die TFLite Edge TPU Modelle?

Häufige Anwendungsfälle für die TFLite Edge TPU Modelle sind:

  • Smart Cameras: Verbesserte Bild- und Videoanalyse in Echtzeit.
  • IoT-Geräte: Smart Home und industrielle Automatisierung ermöglichen.
  • Gesundheitswesen: Beschleunigung der medizinischen Bildgebung und Diagnostik.
  • Einzelhandel: Verbesserung der Bestandsverwaltung und Analyse des Kundenverhaltens.

Diese Anwendungen profitieren von der hohen Leistung und dem niedrigen Stromverbrauch der TFLite Edge TPU Modelle. Entdecke mehr über Einsatzszenarien.

Wie kann ich Probleme beim Export oder Einsatz von TFLite Edge TPU Modellen beheben?

Wenn du beim Export oder Einsatz von TFLite Edge TPU Modellen auf Probleme stößt, findest du in unserem Leitfaden für häufige Probleme Tipps zur Fehlerbehebung. Dieser Leitfaden behandelt häufige Probleme und Lösungen, um einen reibungslosen Betrieb zu gewährleisten. Weitere Unterstützung findest du in unserem Help Center.

📅 Created 7 months ago ✏️ Updated 22 days ago

Kommentare