Vai al contenuto

Live Inference with Streamlit Application using Ultralytics YOLO11

Introduzione

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.



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

AcquacolturaAllevamento di animali
Fish Detection using Ultralytics YOLO11Animals Detection using Ultralytics YOLO11
Fish Detection using Ultralytics YOLO11Animals Detection using Ultralytics YOLO11

Vantaggi dell'inferenza dal vivo

  • 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.
  • Distribuzione facile da usare: L'interfaccia interattiva di Streamlit facilita l'implementazione e l'utilizzo dell'applicazione anche senza conoscenze tecniche approfondite. Gli utenti possono avviare l'inferenza dal vivo con un semplice clic, migliorando l'accessibilità e l'usabilità.
  • 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.

Codice applicazione Streamlit

Ultralytics Installazione

Prima di iniziare a costruire l'applicazione, assicurati di avere installato il pacchetto Ultralytics Python . Puoi installarlo con il comando pip install ultralytics

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

È possibile indicare un modello specifico in Python:

Applicazione Streamlit con un modello personalizzato

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

Conclusione

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.

Per ulteriori miglioramenti, puoi valutare l'aggiunta di altre funzioni come la registrazione del flusso video, il salvataggio dei fotogrammi annotati o l'integrazione con altre librerie di computer vision.

Condividi i tuoi pensieri con la community

Partecipa alla comunità per saperne di più, risolvere i problemi e condividere i tuoi progetti:

Dove trovare aiuto e supporto

Documentazione ufficiale

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

DOMANDE FREQUENTI

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

Quindi, puoi creare un'applicazione Streamlit di base per eseguire l'inferenza dal vivo:

Applicazione Streamlit

from ultralytics import solutions

solutions.inference()

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

Per maggiori dettagli sulla configurazione pratica, consulta la sezione Codice dell'applicazione Streamlit della documentazione.

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.
  • Interfaccia facile da usare: L'interfaccia intuitiva di Streamlit consente un utilizzo e un'implementazione semplici anche senza conoscenze tecniche approfondite.
  • Resource Efficiency: YOLO11's optimized algorithms ensure high-speed processing with minimal computational resources.

Scopri di più su questi vantaggi qui.

Come faccio a distribuire un'applicazione di rilevamento di oggetti Streamlit nel mio browser 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:

  • Sicurezza: Monitoraggio in tempo reale degli accessi non autorizzati.
  • Vendita al dettaglio: Conteggio dei clienti, gestione degli scaffali e molto altro.
  • Animali selvatici e agricoltura: Monitoraggio degli animali e delle condizioni delle colture.

Per approfondire i casi d'uso e gli esempi, esplora le soluzioni diUltralytics .

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:

  • Maggiore velocità e precisione: prestazioni migliorate per le applicazioni in tempo reale.
  • Facilità d'uso: interfacce e distribuzione semplificate.
  • Efficienza delle risorse: Ottimizzato per ottenere una maggiore velocità con requisiti di calcolo minimi.

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

📅 Created 3 months ago ✏️ Updated 22 days ago

Commenti