Are you sure you want to delete this access key?
comments | description | keywords |
---|---|---|
true | Learn how to set up a real-time object detection application using Streamlit and Ultralytics YOLO11. Follow this step-by-step guide to implement webcam-based object detection. | Streamlit, YOLO11, Real-time Object Detection, Streamlit Application, YOLO11 Streamlit Tutorial, Webcam Object Detection |
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's high accuracy and speed ensure seamless performance for live video streams, making it ideal for applications in security, retail, and beyond.
Watch: How to Use Streamlit with Ultralytics for Real-Time Computer Vision in Your Browser
Aquaculture | Animals husbandry |
---|---|
![]() |
![]() |
Fish Detection using Ultralytics YOLO11 | Animals Detection using Ultralytics YOLO11 |
!!! tip "Ultralytics Installation"
Before you start building the application, ensure you have the Ultralytics Python Package installed. You can install it using the command **pip install ultralytics**
!!! example "Inference using Streamlit with Ultralytics YOLO"
=== "CLI"
```bash
yolo solutions inference
yolo solutions inference model="path/to/model.pt"
```
=== "Python"
```python
from ultralytics import solutions
inf = solutions.Inference(
model="yolo11n.pt", # you can use any model that Ultralytics support, i.e. YOLO11, or custom trained model
)
inf.inference()
# Make sure to run the file using command `streamlit run path/to/file.py`
```
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.
Under the hood, the Streamlit application uses the Ultralytics solutions module to create an interactive interface. When you start the inference, the application:
The application provides a clean, user-friendly interface with controls to adjust model parameters and start/stop inference at any time.
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.
For further enhancements, you can explore adding more features such as recording the video stream, saving the annotated frames, or integrating with other computer vision libraries.
Engage with the community to learn more, troubleshoot issues, and share your projects:
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
Then, you can create a basic Streamlit application to run live inference:
!!! example "Streamlit Application"
=== "Python"
```python
from ultralytics import solutions
inf = solutions.Inference(
model="yolo11n.pt", # you can use any model that Ultralytics support, i.e. YOLO11, YOLOv10
)
inf.inference()
# Make sure to run the file using command `streamlit run path/to/file.py`
```
=== "CLI"
```bash
yolo solutions inference
```
For more details on the practical setup, refer to the Streamlit Application Code section of the documentation.
Using Ultralytics YOLO11 with Streamlit for real-time object detection offers several advantages:
Learn more about these benefits in the Advantages of Live Inference section.
After coding your Streamlit application integrating Ultralytics YOLO11, you can deploy it by running:
streamlit run path/to/file.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.
Real-time object detection using Streamlit and Ultralytics YOLO11 can be applied in various sectors:
For more in-depth use cases and examples, explore Ultralytics Solutions.
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.
Press p or to see the previous file or, n or to see the next file
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?