跳至内容

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 YOLO11 Animals Detection using Ultralytics YOLO11
Fish Detection using Ultralytics YOLO11 Animals 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.

流光应用代码

Ultralytics 安装

在开始构建应用程序之前,请确保已安装Ultralytics Python 软件包。可以使用pip install命令安装 ultralytics

流光应用

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.

为进一步增强功能,您可以探索添加更多功能,如录制视频流、保存注释帧或与其他计算机视觉库集成。

与社区分享您的想法

与社区互动,了解更多信息、排除故障并分享您的项目:

在哪里可以找到帮助和支持

官方文件

  • 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 应用程序来运行实时推理:

流光应用

from ultralytics import solutions

solutions.inference()

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

有关实际设置的更多详情,请参阅文档中的Streamlit 应用代码部分

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 Object 检测应用程序?

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 解决方案

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.


📅创建于 3 个月前 ✏️已更新 12 天前

评论