Zum Inhalt springen

Live Inference with Streamlit Application using Ultralytics YOLO11

Einführung

Streamlit makes it simple to build and deploy interactive web applications. Combining this with Ultralytics YOLO11 allows for real-time object detection and analysis directly in your browser. YOLO11 high accuracy and speed ensure seamless performance for live video streams, making it ideal for applications in security, retail, and beyond.



Pass auf: How to Use Streamlit with Ultralytics for Real-Time Computer Vision in Your Browser

Aquakultur Haltung von Tieren
Fish Detection using Ultralytics YOLO11 Animals Detection using Ultralytics YOLO11
Fish Detection using Ultralytics YOLO11 Animals Detection using Ultralytics YOLO11

Vorteile der Live-Inferenz

  • Seamless Real-Time Object Detection: Streamlit combined with YOLO11 enables real-time object detection directly from your webcam feed. This allows for immediate analysis and insights, making it ideal for applications requiring instant feedback.
  • Benutzerfreundlicher Einsatz: Die interaktive Benutzeroberfläche von Streamlit macht es einfach, die Anwendung ohne umfassende technische Kenntnisse einzusetzen und zu nutzen. Die Nutzer können die Live-Inferenz mit einem einfachen Klick starten, was die Zugänglichkeit und Benutzerfreundlichkeit verbessert.
  • Efficient Resource Utilization: YOLO11 optimized algorithm ensure high-speed processing with minimal computational resources. This efficiency allows for smooth and reliable webcam inference even on standard hardware, making advanced computer vision accessible to a wider audience.

Streamlit Anwendungscode

Ultralytics Installation

Bevor du mit der Erstellung der Anwendung beginnst, musst du sicherstellen, dass du das Ultralytics Python Paket installiert hast. Du kannst es mit dem Befehl pip install installieren ultralytics

Streamlit-Anwendung

from ultralytics import solutions

solutions.inference()

### Make sure to run the file using command `streamlit run <file-name.py>`
yolo streamlit-predict

This will launch the Streamlit application in your default web browser. You will see the main title, subtitle, and the sidebar with configuration options. Select your desired YOLO11 model, set the confidence and NMS thresholds, and click the "Start" button to begin the real-time object detection.

Optional kannst du unter Python ein bestimmtes Modell angeben:

Streamlit-Anwendung mit einem benutzerdefinierten Modell

from ultralytics import solutions

# Pass a model as an argument
solutions.inference(model="path/to/model.pt")

### Make sure to run the file using command `streamlit run <file-name.py>`

Fazit

By following this guide, you have successfully created a real-time object detection application using Streamlit and Ultralytics YOLO11. This application allows you to experience the power of YOLO11 in detecting objects through your webcam, with a user-friendly interface and the ability to stop the video stream at any time.

Für weitere Verbesserungen kannst du weitere Funktionen hinzufügen, z. B. die Aufzeichnung des Videostreams, das Speichern der kommentierten Bilder oder die Integration mit anderen Computer Vision Bibliotheken.

Teilen Sie Ihre Gedanken mit der Community

Beteilige dich an der Community, um mehr zu erfahren, Probleme zu beheben und deine Projekte zu teilen:

Wo Sie Hilfe und Support finden

  • GitHub Issues: Besuche das Ultralytics GitHub Repository, um Fragen zu stellen, Fehler zu melden und Funktionen vorzuschlagen.
  • Ultralytics Discord-Server: Treten Sie dem Ultralytics Discord-Server , um sich mit anderen Benutzern und Entwicklern zu verbinden, Unterstützung zu erhalten, Wissen auszutauschen und Ideen zu sammeln.

Offizielle Dokumentation

  • Ultralytics YOLO11 Documentation: Refer to the official YOLO11 documentation for comprehensive guides and insights on various computer vision tasks and projects.

FAQ

How can I set up a real-time object detection application using Streamlit and Ultralytics YOLO11?

Setting up a real-time object detection application with Streamlit and Ultralytics YOLO11 is straightforward. First, ensure you have the Ultralytics Python package installed using:

pip install ultralytics

Dann kannst du eine einfache Streamlit-Anwendung erstellen, um Live-Inferenzen durchzuführen:

Streamlit-Anwendung

from ultralytics import solutions

solutions.inference()

### Make sure to run the file using command `streamlit run <file-name.py>`
yolo streamlit-predict

Weitere Details zur praktischen Einrichtung findest du im Abschnitt Streamlit Application Code in der Dokumentation.

What are the main advantages of using Ultralytics YOLO11 with Streamlit for real-time object detection?

Using Ultralytics YOLO11 with Streamlit for real-time object detection offers several advantages:

  • Seamless Real-Time Detection: Achieve high-accuracy, real-time object detection directly from webcam feeds.
  • Benutzerfreundliches Interface: Die intuitive Benutzeroberfläche von Streamlit ermöglicht eine einfache Nutzung und Bereitstellung ohne umfassende technische Kenntnisse.
  • Resource Efficiency: YOLO11's optimized algorithms ensure high-speed processing with minimal computational resources.

Mehr über diese Vorteile erfährst du hier.

Wie kann ich eine Streamlit-Objekterkennungsanwendung in meinem Webbrowser einsetzen?

After coding your Streamlit application integrating Ultralytics YOLO11, you can deploy it by running:

streamlit run <file-name.py>

This command will launch the application in your default web browser, enabling you to select YOLO11 models, set confidence, and NMS thresholds, and start real-time object detection with a simple click. For a detailed guide, refer to the Streamlit Application Code section.

What are some use cases for real-time object detection using Streamlit and Ultralytics YOLO11?

Real-time object detection using Streamlit and Ultralytics YOLO11 can be applied in various sectors:

  • Sicherheit: Echtzeit-Überwachung auf unbefugten Zugriff.
  • Einzelhandel: Kundenzählung, Regalverwaltung und mehr.
  • Wildtiere und Landwirtschaft: Überwachung von Tieren und Erntebedingungen.

Ausführlichere Anwendungsfälle und Beispiele findest du unter Ultralytics Lösungen.

How does Ultralytics YOLO11 compare to other object detection models like YOLOv5 and RCNNs?

Ultralytics YOLO11 provides several enhancements over prior models like YOLOv5 and RCNNs:

  • Höhere Geschwindigkeit und Genauigkeit: Verbesserte Leistung für Echtzeitanwendungen.
  • Benutzerfreundlichkeit: Vereinfachte Schnittstellen und Bereitstellung.
  • Ressourceneffizienz: Optimiert für mehr Geschwindigkeit bei minimalem Rechenaufwand.

For a comprehensive comparison, check Ultralytics YOLO11 Documentation and related blog posts discussing model performance.


📅 Created 3 months ago ✏️ Updated 16 days ago

Kommentare