Giter Club home page Giter Club logo

detection-tracking's Introduction

Real-time Object Detection and Tracking with YOLOv8 and Streamlit

This repository is a comprehensive open-source project that demonstrates the integration of object detection and tracking using the YOLOv8 object detection algorithm and Streamlit, a popular Python web application framework for building interactive web applications. This project provides a user-friendly and customizable interface that can detect and track objects in real-time video streams.

Demo WebApp

This app is up and running on Streamlit cloud server!!! Thanks 'Streamlit' for the community support for the cloud upload. You can check the demo of this web application on the link below.

yolov8-streamlit-detection-tracking-webapp

Tracking With Object Detection Demo

Tracking-With_object-Detection-MOV.mov

Demo Pics

Home page

Page after uploading an image and object detection

Segmentation task on image

Requirements

Python 3.6+ YOLOv8 Streamlit

pip install ultralytics streamlit pytube

Installation

Usage

  • Run the app with the following command: streamlit run app.py
  • The app should open in a new browser window.

ML Model Config

  • Select task (Detection, Segmentation)
  • Select model confidence
  • Use the slider to adjust the confidence threshold (25-100) for the model.

One the model config is done, select a source.

Detection on images

  • The default image with its objects-detected image is displayed on the main page.
  • Select a source. (radio button selection Image).
  • Upload an image by clicking on the "Browse files" button.
  • Click the "Detect Objects" button to run the object detection algorithm on the uploaded image with the selected confidence threshold.
  • The resulting image with objects detected will be displayed on the page. Click the "Download Image" button to download the image.("If save image to download" is selected)

Detection in Videos

  • Create a folder with name videos in the same directory
  • Dump your videos in this folder
  • In settings.py edit the following lines.
# video
VIDEO_DIR = ROOT / 'videos' # After creating the videos folder

# Suppose you have four videos inside videos folder
# Edit the name of video_1, 2, 3, 4 (with the names of your video files) 
VIDEO_1_PATH = VIDEO_DIR / 'video_1.mp4' 
VIDEO_2_PATH = VIDEO_DIR / 'video_2.mp4'
VIDEO_3_PATH = VIDEO_DIR / 'video_3.mp4'
VIDEO_4_PATH = VIDEO_DIR / 'video_4.mp4'

# Edit the same names here also.
VIDEOS_DICT = {
    'video_1': VIDEO_1_PATH,
    'video_2': VIDEO_2_PATH,
    'video_3': VIDEO_3_PATH,
    'video_4': VIDEO_4_PATH,
}

# Your videos will start appearing inside streamlit webapp 'Choose a video'.
  • Click on Detect Video Objects button and the selected task (detection/segmentation) will start on the selected video.

Detection on RTSP

  • Select the RTSP stream button
  • Enter the rtsp url inside the textbox and hit Detect Objects button

Detection on YouTube Video URL

  • Select the source as YouTube
  • Copy paste the url inside the text box.
  • The detection/segmentation task will start on the YouTube video url
movobjdetyoutubeurl.mov

Acknowledgements

This app is based on the YOLOv8(https://github.com/ultralytics/ultralytics) object detection algorithm. The app uses the Streamlit(https://github.com/streamlit/streamlit) library for the user interface.

Disclaimer

Please note that this project is intended for educational purposes only and should not be used in production environments.

Hit star โญ if you like this repo!!!

detection-tracking's People

Contributors

tarekeesa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.