Skip to content

Live Inference with Streamlit Application using Ultralytics YOLO11

Introduction

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.



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

Aquaculture Élevage d'animaux
Fish Detection using Ultralytics YOLO11 Animals Detection using Ultralytics YOLO11
Fish Detection using Ultralytics YOLO11 Animals Detection using Ultralytics YOLO11

Avantages de l'inférence en direct

  • 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.
  • DĂ©ploiement convivial: L'interface interactive de Streamlit facilite le dĂ©ploiement et l'utilisation de l'application sans connaissances techniques approfondies. Les utilisateurs peuvent dĂ©marrer l'infĂ©rence en direct d'un simple clic, ce qui amĂ©liore l'accessibilitĂ© et la convivialitĂ©.
  • 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.

Code d'application Streamlit

Ultralytics Installation

Avant de commencer à construire l'application, assure-toi que le paquet Ultralytics Python est installé. Tu peux l'installer à l'aide de la commande pip install ultralytics

Application Streamlit

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.

En option, tu peux fournir un modèle spécifique sur Python:

Application Streamlit avec un modèle personnalisé

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>`

Conclusion

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.

Pour d'autres améliorations, tu peux explorer l'ajout de fonctionnalités supplémentaires telles que l'enregistrement du flux vidéo, la sauvegarde des images annotées ou l'intégration avec d'autres bibliothèques de vision par ordinateur.

Partagez vos réflexions avec la communauté

Engage-toi auprès de la communauté pour en savoir plus, résoudre les problèmes et partager tes projets :

Où trouver de l’aide et du soutien

Documentation officielle

  • 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

Ensuite, tu peux créer une application Streamlit de base pour exécuter une inférence en direct :

Application Streamlit

from ultralytics import solutions

solutions.inference()

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

Pour plus de détails sur la configuration pratique, reporte-toi à la section Code d'application Streamlit de la documentation.

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.
  • Interface conviviale: L'interface intuitive de Streamlit permet une utilisation et un dĂ©ploiement faciles sans connaissances techniques approfondies.
  • Resource Efficiency: YOLO11's optimized algorithms ensure high-speed processing with minimal computational resources.

Découvre plus en détail ces avantages ici.

Comment déployer une application de détection d'objets Streamlit dans mon navigateur web ?

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:

  • SĂ©curitĂ©: Surveillance en temps rĂ©el des accès non autorisĂ©s.
  • Commerce de dĂ©tail: Comptage des clients, gestion des rayons, et plus encore.
  • La faune et l'agriculture: Surveillance des animaux et de l'Ă©tat des cultures.

Pour des cas d'utilisation et des exemples plus approfondis, explore Ultralytics Solutions.

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:

  • Vitesse et prĂ©cision accrues: performances amĂ©liorĂ©es pour les applications en temps rĂ©el.
  • FacilitĂ© d'utilisation: interfaces et dĂ©ploiement simplifiĂ©s.
  • EfficacitĂ© des ressources: OptimisĂ© pour une meilleure vitesse avec des exigences informatiques minimales.

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


📅 Created 3 months ago ✏️ Updated 16 days ago

Commentaires