ΠŸΠ΅Ρ€Π΅ΠΉΡ‚ΠΈ ΠΊ содСрТимому

Live Inference with Streamlit Application using Ultralytics YOLO11

Π’Π²Π΅Π΄Π΅Π½ΠΈΠ΅

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.



Π‘ΠΌΠΎΡ‚Ρ€ΠΈ: How to Use Streamlit with Ultralytics for Real-Time Computer Vision in Your Browser

ΠΠΊΠ²Π°ΠΊΡƒΠ»ΡŒΡ‚ΡƒΡ€Π°Π–ΠΈΠ²ΠΎΡ‚Π½ΠΎΠ²ΠΎΠ΄ΡΡ‚Π²ΠΎ
Fish Detection using Ultralytics YOLO11Animals Detection using Ultralytics YOLO11
Fish Detection using Ultralytics YOLO11Animals Detection using Ultralytics YOLO11

ΠŸΡ€Π΅ΠΈΠΌΡƒΡ‰Π΅ΡΡ‚Π²Π° ΠΆΠΈΠ²ΠΎΠ³ΠΎ ΡƒΠΌΠΎΠ·Π°ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΡ

  • 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.
  • Π£Π΄ΠΎΠ±Π½ΠΎΠ΅ Ρ€Π°Π·Π²Π΅Ρ€Ρ‚Ρ‹Π²Π°Π½ΠΈΠ΅: Π˜Π½Ρ‚Π΅Ρ€Π°ΠΊΡ‚ΠΈΠ²Π½Ρ‹ΠΉ интСрфСйс Streamlit позволяСт Π»Π΅Π³ΠΊΠΎ Ρ€Π°Π·Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ ΠΈ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π±Π΅Π· ΠΎΠ±ΡˆΠΈΡ€Π½Ρ‹Ρ… тСхничСских Π·Π½Π°Π½ΠΈΠΉ. ΠŸΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΠΈ ΠΌΠΎΠ³ΡƒΡ‚ Π½Π°Ρ‡Π°Ρ‚ΡŒ ΠΆΠΈΠ²Ρ‹Π΅ ΡƒΠΌΠΎΠ·Π°ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΡ простым Ρ‰Π΅Π»Ρ‡ΠΊΠΎΠΌ ΠΌΡ‹ΡˆΠΈ, Ρ‡Ρ‚ΠΎ ΠΏΠΎΠ²Ρ‹ΡˆΠ°Π΅Ρ‚ Π΄ΠΎΡΡ‚ΡƒΠΏΠ½ΠΎΡΡ‚ΡŒ ΠΈ удобство использования.
  • 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

Ultralytics Установка

ΠŸΡ€Π΅ΠΆΠ΄Π΅ Ρ‡Π΅ΠΌ ΠΏΡ€ΠΈΡΡ‚ΡƒΠΏΠΈΡ‚ΡŒ ΠΊ сборкС прилоТСния, ΡƒΠ±Π΅Π΄ΠΈΡΡŒ, Ρ‡Ρ‚ΠΎ Ρƒ тСбя установлСн ΠΏΠ°ΠΊΠ΅Ρ‚ Ultralytics Python . Π’Ρ‹ моТСшь ΡƒΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚ΡŒ Π΅Π³ΠΎ с ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ ΠΊΠΎΠΌΠ°Π½Π΄Ρ‹ pip install ultralytics

ΠŸΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ 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.

ΠŸΡ€ΠΈ ΠΆΠ΅Π»Π°Π½ΠΈΠΈ Ρ‚Ρ‹ моТСшь ΡƒΠΊΠ°Π·Π°Ρ‚ΡŒ ΠΊΠΎΠ½ΠΊΡ€Π΅Ρ‚Π½ΡƒΡŽ модСль Π½Π° сайтС Python:

ΠŸΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Streamlit с ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒΡΠΊΠΎΠΉ модСлью

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

Π—Π°ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅

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.

Для дальнСйшСго ΡΠΎΠ²Π΅Ρ€ΡˆΠ΅Π½ΡΡ‚Π²ΠΎΠ²Π°Π½ΠΈΡ Ρ‚Ρ‹ моТСшь ΠΈΠ·ΡƒΡ‡ΠΈΡ‚ΡŒ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡ‚ΡŒ добавлСния Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Ρ… Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΉ, Ρ‚Π°ΠΊΠΈΡ… ΠΊΠ°ΠΊ запись Π²ΠΈΠ΄Π΅ΠΎΠΏΠΎΡ‚ΠΎΠΊΠ°, сохранСниС Π°Π½Π½ΠΎΡ‚ΠΈΡ€ΠΎΠ²Π°Π½Π½Ρ‹Ρ… ΠΊΠ°Π΄Ρ€ΠΎΠ² ΠΈΠ»ΠΈ интСграция с Π΄Ρ€ΡƒΠ³ΠΈΠΌΠΈ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ°ΠΌΠΈ ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€Π½ΠΎΠ³ΠΎ зрСния.

ΠŸΠΎΠ΄Π΅Π»ΠΈΡ‚Π΅ΡΡŒ своими мыслями с сообщСством

ВзаимодСйствуй с сообщСством, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΡƒΠ·Π½Π°Ρ‚ΡŒ большС, ΡƒΡΡ‚Ρ€Π°Π½ΠΈΡ‚ΡŒ Π½Π΅ΠΏΠΎΠ»Π°Π΄ΠΊΠΈ ΠΈ ΠΏΠΎΠ΄Π΅Π»ΠΈΡ‚ΡŒΡΡ своими ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π°ΠΌΠΈ:

Π“Π΄Π΅ ΠΏΠΎΠ»ΡƒΡ‡ΠΈΡ‚ΡŒ ΠΏΠΎΠΌΠΎΡ‰ΡŒ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΡƒ

  • GitHub Issues: ΠŸΠΎΡΠ΅Ρ‚ΠΈ Ρ€Π΅ΠΏΠΎΠ·ΠΈΡ‚ΠΎΡ€ΠΈΠΉUltralytics Π½Π° GitHub, Ρ‡Ρ‚ΠΎΠ±Ρ‹ Π·Π°Π΄Π°Ρ‚ΡŒ вопросы, ΡΠΎΠΎΠ±Ρ‰ΠΈΡ‚ΡŒ ΠΎΠ± ΠΎΡˆΠΈΠ±ΠΊΠ°Ρ… ΠΈ ΠΏΡ€Π΅Π΄Π»ΠΎΠΆΠΈΡ‚ΡŒ свои возмоТности.
  • Ultralytics Π‘Π΅Ρ€Π²Π΅Ρ€ Discord: ΠŸΡ€ΠΈΡΠΎΠ΅Π΄ΠΈΠ½ΡΠΉΡΡ ΠΊ сСрвСруUltralytics Discord, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΎΠ±Ρ‰Π°Ρ‚ΡŒΡΡ с Π΄Ρ€ΡƒΠ³ΠΈΠΌΠΈ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡΠΌΠΈ ΠΈ Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠ°ΠΌΠΈ, ΠΏΠΎΠ»ΡƒΡ‡Π°Ρ‚ΡŒ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΡƒ, Π΄Π΅Π»ΠΈΡ‚ΡŒΡΡ знаниями ΠΈ ΠΎΠ±ΠΌΠ΅Π½ΠΈΠ²Π°Ρ‚ΡŒΡΡ идСями.

ΠžΡ„ΠΈΡ†ΠΈΠ°Π»ΡŒΠ½Π°Ρ докумСнтация

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

Π’ΠžΠŸΠ ΠžΠ‘Π« И ΠžΠ’Π’Π•Π’Π«

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

Π—Π°Ρ‚Π΅ΠΌ Ρ‚Ρ‹ моТСшь ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ Π±Π°Π·ΠΎΠ²ΠΎΠ΅ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Streamlit, Ρ‡Ρ‚ΠΎΠ±Ρ‹ Π·Π°ΠΏΡƒΡΠΊΠ°Ρ‚ΡŒ ΠΆΠΈΠ²Ρ‹Π΅ ΡƒΠΌΠΎΠ·Π°ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΡ:

ΠŸΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Streamlit

from ultralytics import solutions

solutions.inference()

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

Π‘ΠΎΠ»Π΅Π΅ ΠΏΠΎΠ΄Ρ€ΠΎΠ±Π½ΠΎ ΠΎ практичСской настройкС Ρ‡ΠΈΡ‚Π°ΠΉ Π² Ρ€Π°Π·Π΄Π΅Π»Π΅ Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π°Ρ†ΠΈΠΈ Streamlit Application Code.

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.
  • Π£Π΄ΠΎΠ±Π½Ρ‹ΠΉ интСрфСйс: Π˜Π½Ρ‚ΡƒΠΈΡ‚ΠΈΠ²Π½ΠΎ понятный интСрфСйс Streamlit позволяСт Π»Π΅Π³ΠΊΠΎ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ ΠΈ Ρ€Π°Π·Π²Π΅Ρ€Ρ‚Ρ‹Π²Π°Ρ‚ΡŒ систСму Π±Π΅Π· ΠΎΠ±ΡˆΠΈΡ€Π½Ρ‹Ρ… тСхничСских Π·Π½Π°Π½ΠΈΠΉ.
  • Resource Efficiency: YOLO11's optimized algorithms ensure high-speed processing with minimal computational resources.

Π£Π·Π½Π°ΠΉ большС ΠΎΠ± этих прСимущСствах здСсь.

Как Ρ€Π°Π·Π²Π΅Ρ€Π½ΡƒΡ‚ΡŒ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ для обнаруТСния ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ΠΎΠ² Streamlit Π² Π²Π΅Π±-Π±Ρ€Π°ΡƒΠ·Π΅Ρ€Π΅?

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:

  • Π‘Π΅Π·ΠΎΠΏΠ°ΡΠ½ΠΎΡΡ‚ΡŒ: ΠœΠΎΠ½ΠΈΡ‚ΠΎΡ€ΠΈΠ½Π³ Π² Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠΌ Π²Ρ€Π΅ΠΌΠ΅Π½ΠΈ Π½Π° ΠΏΡ€Π΅Π΄ΠΌΠ΅Ρ‚ нСсанкционированного доступа.
  • Розничная торговля: ΠŸΠΎΠ΄ΡΡ‡Π΅Ρ‚ ΠΏΠΎΠΊΡƒΠΏΠ°Ρ‚Π΅Π»Π΅ΠΉ, ΡƒΠΏΡ€Π°Π²Π»Π΅Π½ΠΈΠ΅ ΠΏΠΎΠ»ΠΊΠ°ΠΌΠΈ ΠΈ ΠΌΠ½ΠΎΠ³ΠΎΠ΅ Π΄Ρ€ΡƒΠ³ΠΎΠ΅.
  • Дикая ΠΏΡ€ΠΈΡ€ΠΎΠ΄Π° ΠΈ сСльскоС хозяйство: Π‘Π»Π΅Π΄ΠΈ Π·Π° состояниСм ΠΆΠΈΠ²ΠΎΡ‚Π½Ρ‹Ρ… ΠΈ ΡΠ΅Π»ΡŒΡΠΊΠΎΡ…ΠΎΠ·ΡΠΉΡΡ‚Π²Π΅Π½Π½Ρ‹Ρ… ΠΊΡƒΠ»ΡŒΡ‚ΡƒΡ€.

Π§Ρ‚ΠΎΠ±Ρ‹ ΡƒΠ·Π½Π°Ρ‚ΡŒ большС ΠΏΠΎΠ΄Ρ€ΠΎΠ±Π½Ρ‹Ρ… ΠΏΡ€ΠΈΠΌΠ΅Ρ€ΠΎΠ² использования, ΠΈΠ·ΡƒΡ‡ΠΈ 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:

  • Π‘ΠΎΠ»Π΅Π΅ высокая ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ ΠΈ Ρ‚ΠΎΡ‡Π½ΠΎΡΡ‚ΡŒ: ΡƒΠ»ΡƒΡ‡ΡˆΠ΅Π½Π½Π°Ρ ΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ для ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΉ, Ρ€Π°Π±ΠΎΡ‚Π°ΡŽΡ‰ΠΈΡ… Π² Ρ€Π΅ΠΆΠΈΠΌΠ΅ Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠ³ΠΎ Π²Ρ€Π΅ΠΌΠ΅Π½ΠΈ.
  • ΠŸΡ€ΠΎΡΡ‚ΠΎΡ‚Π° использования: ΡƒΠΏΡ€ΠΎΡ‰Π΅Π½Π½Ρ‹Π΅ интСрфСйсы ΠΈ Ρ€Π°Π·Π²Π΅Ρ€Ρ‚Ρ‹Π²Π°Π½ΠΈΠ΅.
  • Π­Ρ„Ρ„Π΅ΠΊΡ‚ΠΈΠ²Π½ΠΎΡΡ‚ΡŒ использования рСсурсов: ΠžΠΏΡ‚ΠΈΠΌΠΈΠ·ΠΈΡ€ΠΎΠ²Π°Π½ для Π»ΡƒΡ‡ΡˆΠ΅ΠΉ скорости ΠΏΡ€ΠΈ ΠΌΠΈΠ½ΠΈΠΌΠ°Π»ΡŒΠ½Ρ‹Ρ… Π²Ρ‹Ρ‡ΠΈΡΠ»ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Ρ… трСбованиях.

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

πŸ“… Created 4 months ago ✏️ Updated 1 month ago

ΠšΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΈ