Green check
Link copied to clipboard

Run an interactive AI app with Streamlit and Ultralytics YOLO11

Learn how to run YOLO11 inferences inside a Streamlit interface and build an interactive AI interface for computer vision tasks without coding expertise.

Computer vision models are impactful AI tools that enable machines to interpret and analyze visual data, performing tasks like object detection, image classification, and instance segmentation with high accuracy. However, they can sometimes require additional technical expertise, such as web development or mobile app skills, to deploy and make them accessible to a wider audience.

Take Ultralytics YOLO11, for example. It is a model that supports various tasks and is useful across a range of applications. However, without some technical front-end knowledge, building and deploying a user-friendly interface for seamless interaction can feel a little challenging for some AI engineers.

Streamlit is an open-source framework that aims to make this process easier. It’s a Python-based tool for building interactive applications without complex front-end development. When paired with YOLO11, it lets users upload images, process videos, and visualize real-time results with minimal effort.

Ultralytics takes this a step further with its Live Inference solution, making Streamlit integration even easier. With a single command, users can launch a pre-built Streamlit app for YOLO11, eliminating the need for manual setup and coding. 

In this article, we’ll walk through how to set up and run YOLO11 using Ultralytics’ Live Inference solution with Streamlit, making real-time AI deployment faster and more accessible.

What is Streamlit?

Streamlit is a Python framework that simplifies the creation of interactive web applications. AI developers can build AI-powered apps without having to deal with the intricacies of front-end development. 

It is designed to work seamlessly with AI and machine learning models. With just a few lines of Python, developers can create an interface where users can upload images, process videos, and interact with AI models.

Fig 1. Key features of Streamlit. Image by author.

One of its key features is dynamic rendering. When users make changes, the app updates automatically without requiring manual page reloads.

Also, since it is lightweight and easy to use, Streamlit runs efficiently on both local machines and cloud platforms. This makes it a great choice for deploying AI applications, sharing models with others, and providing an intuitive, interactive user experience.

Ultralytics YOLO11: A versatile Vision AI model

Before diving into how to run live inferences with Ultralytics YOLO11 in a Streamlit application, let’s take a closer look at what makes YOLO11 so reliable.

Ultralytics YOLO11 is a model designed for real-time computer vision tasks such as object detection, instance segmentation, and pose estimation. It delivers high-speed performance with impressive accuracy.

Fig 2. An example of using YOLO11 for object detection.

One of YOLO11’s biggest advantages is its ease of use. There’s no need for complex setups; developers can install the Ultralytics Python package and start making predictions with just a few lines of code.

The Ultralytics Python package provides a range of features, allowing users to fine-tune models and adjust detection settings. It also helps optimize performance across different devices for smoother deployment.

Beyond flexibility, the Ultralytics Python package supports integrations across multiple platforms, including edge devices, cloud environments, and NVIDIA GPU-enabled systems. Whether deployed on a small embedded device or a large-scale cloud server, YOLO11 adapts effortlessly, making advanced vision AI more accessible than ever.

Benefits of using Streamlit with Ultralytics YOLO11

You might be wondering, how do I know if Streamlit is the right deployment option for me? If you're looking for a simple, code-efficient way to run YOLO11 without dealing with front-end development, Streamlit is a good option - especially for prototyping, proof-of-concept (PoC) projects, or deployments aimed at a smaller number of users.

It streamlines the process of working with YOLO11 by eliminating unnecessary complexity and providing an intuitive interface for real-time interaction. Here are some other key advantages:

  • Customizable AI controls: You can add sliders, dropdowns, and buttons to your interface, allowing users to fine-tune detection settings and filter specific objects easily.
  • Integration with other AI tools: Streamlit supports integration with NumPy, OpenCV, Matplotlib, and other machine-learning libraries, enhancing AI workflow capabilities.
  • Interactive data visualization: Built-in support for charts and graphs allows users to visualize object detection, segmentation results, or tracking insights effortlessly.
  • Collaboration-friendly: Streamlit apps can be easily shared with team members, stakeholders, or clients through a simple link, enabling instant feedback and iteration.

Step-by-step guide to deploying YOLO11 in a Streamlit web app

Now that we've explored the benefits of using Streamlit with YOLO11, let’s walk through how to run real-time computer vision tasks in a browser using Streamlit with YOLO11.

Installing the Ultralytics Python package

The first step is to install the Ultralytics Python package. This can be done using the following command:

1# Install the ultralytics package from PyPI
2pip install ultralytics

Once installed, YOLO11 is ready to use without any complicated setup. If you encounter any issues while installing the required packages, you can refer to our Common Issues Guide for troubleshooting tips and solutions.

Launching the Streamlit application with YOLO11 

Normally, you would need to develop a Python script using Streamlit components to run YOLO11. However, Ultralytics provides a simple way to run YOLO11 with Streamlit. 

Running the following Python script will instantly launch the Streamlit application in your default web browser:

1from ultralytics import solutions
2
3inf = solutions.Inference(
4    model="yolo11n.pt",  # you can use any model that Ultralytics support, i.e. YOLO11, or custom trained model
5)
6
7inf.inference()
8
9### Make sure to run the file using command `streamlit run <file-name.py>`

No additional configuration is needed. The Streamlit application interface includes an upload section for images and videos, a drop-down menu to select the YOLO11 model variant you are interested in, and sliders to adjust detection confidence. Everything is neatly organized, making it possible for users to run inferences effortlessly without writing extra code.

Running inferences using YOLO11 on the Streamlit application

Now that the Streamlit application is running in your web browser, let’s explore how to use it to run inferences with YOLO11.

For example, let's say we want to analyze a video file for object detection. Here are the steps to upload a file, select a model, and view real-time results:

  • Upload a video file: Select "video" from the user configuration drop-down, which tells the application to process a pre-recorded file instead of a webcam feed.
  • Choose a YOLO11 model: Select "YOLO11l" from the model drop-down for object detection using a large YOLO11 model.
  • Start the detection process: Click "Start", allowing YOLO11 to analyze the video frame by frame and detect objects in real-time.
  • View the processed video: Watch as the video appears on the screen with live updates, displaying detected objects with bounding boxes.
  • Interact with results in Streamlit: Use the interface to adjust settings or analyze detections, all without extra setup or coding.
Fig 3. The Ultralytics YOLO Streamlit application interface.

Use cases using Streamlit and YOLO11

We’ve taken a look at how Streamlit is great for creating prototypes, research tools, and small to medium-sized applications. It offers a simple way to deploy AI models without complex front-end development.

However, running YOLO11 with Streamlit isn’t always an out-of-the-box solution - unless you use the Ultralytics YOLO Streamlit application we set up in the steps above. In most cases, some development work is required to customize the application to fit specific needs. While Streamlit simplifies deployment, you’ll still need to configure the necessary components to ensure YOLO11 runs smoothly.

Let's explore two practical examples of how Ultralytics YOLO11 can be effectively deployed with Streamlit in real-world scenarios.

Counting objects for inventory checks using YOLO11

Keeping track of inventory in retail stores, storage rooms, or office supply areas can be time-consuming and prone to errors. Using YOLO11 with Streamlit, businesses can automate object counting quickly and efficiently, making it a great option for a proof of concept (PoC) before committing to a large-scale deployment.

With this setup, users can upload an image or use a live camera feed, and YOLO11 can help instantly detect and count objects. The real-time count can be displayed in the Streamlit interface, providing an easy way to monitor stock levels without manual effort.

For example, a store owner can scan a shelf and immediately see how many bottles, boxes, or packaged goods are present without having to count them manually. By leveraging YOLO11 and Streamlit, businesses can reduce manual work, improve accuracy, and explore automation with minimal investment.

Fig 4. Detecting bottles in a fridge using YOLO11.

Boosting security with YOLO11 and Streamlit

Keeping restricted areas secure in offices, warehouses, or event venues can be difficult, especially with manual monitoring. Using YOLO11 with Streamlit, businesses can set up a simple AI-powered security system to detect unauthorized access in real time.

A camera feed can be connected to the Streamlit interface, where YOLO11 is used to identify and track people entering restricted zones. If an unauthorized person is detected, the system can trigger an alert or log the event for review.

For example, a warehouse manager can monitor access to high-security storage areas, or an office can track movement in restricted sections without needing constant supervision.

This can be an eye-opening project for businesses wanting to explore Vision AI-driven security monitoring before committing to a larger, fully automated system. By integrating YOLO11 with Streamlit, businesses can enhance security, minimize manual monitoring, and respond to unauthorized access more effectively.

Tips for monitoring an interactive AI app with Streamlit

Using tools like Streamlit to deploy computer vision models helps create an interactive and user-friendly experience. However, after setting up the live interface, it’s important to ensure the system runs efficiently and delivers accurate results over time.

Here are some key factors to consider after deployment:

  • Regular monitoring: Track detection accuracy, inference speed, and resource usage. Adjust model parameters or upgrade hardware if performance declines.
  • Managing multiple users and scalability: As user demand grows, optimizing infrastructure is key to maintaining performance. Cloud platforms and scalable deployment solutions help ensure smooth operation.
  • Keeping the model updated: Keeping the model and libraries updated enhances accuracy, security, and access to new features.

Key takeaways

Ultralytics simplifies YOLO11 deployment with a ready-to-use Streamlit live interface that runs with a single command - no coding required. This allows users to start using real-time object detection instantly.

The interface also includes built-in customization, enabling users to switch models, adjust detection accuracy, and filter objects with ease. Everything is managed within a simple, user-friendly interface, eliminating the need for manual UI development. By combining

YOLO11’s capabilities with Streamlit’s ease of deployment, businesses and developers can quickly prototype, test, and refine AI-driven applications. 

Become a part of our community and explore our GitHub repository for more insights into AI. Take a look at our solutions pages to learn more about innovations like AI in manufacturing and computer vision in healthcare. Check out our licensing options and get started today!

Facebook logoTwitter logoLinkedIn logoCopy-link symbol

Read more in this category

Let’s build the future
of AI together!

Begin your journey with the future of machine learning