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 YOLOv8. Follow this step-by-step guide to implement webcam-based object detection. | Streamlit, YOLOv8, Real-time Object Detection, Streamlit Application, YOLOv8 Streamlit Tutorial, Webcam Object Detection |
Streamlit makes it simple to build and deploy interactive web applications. Combining this with Ultralytics YOLOv8 allows for real-time object detection and analysis directly in your browser. YOLOv8 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 YOLOv8 | Animals Detection using Ultralytics YOLOv8 |
!!! 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 "Streamlit Application"
=== "Python"
```python
from ultralytics import solutions
solutions.inference()
### Make sure to run the file using command `streamlit run <file-name.py>`
```
=== "CLI"
```bash
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 YOLOv8 model, set the confidence and NMS thresholds, and click the "Start" button to begin the real-time object detection.
You can optionally supply a specific model in Python:
!!! example "Streamlit Application with a custom model"
=== "Python"
```python
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 YOLOv8. This application allows you to experience the power of YOLOv8 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 YOLOv8 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
solutions.inference()
### Make sure to run the file using command `streamlit run <file-name.py>`
```
=== "CLI"
```bash
yolo streamlit-predict
```
For more details on the practical setup, refer to the Streamlit Application Code section of the documentation.
Using Ultralytics YOLOv8 with Streamlit for real-time object detection offers several advantages:
Discover more about these advantages here.
After coding your Streamlit application integrating Ultralytics YOLOv8, 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 YOLOv8 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 YOLOv8 can be applied in various sectors:
For more in-depth use cases and examples, explore Ultralytics Solutions.
Ultralytics YOLOv8 provides several enhancements over prior models like YOLOv5 and RCNNs:
For a comprehensive comparison, check Ultralytics YOLOv8 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?