Git Product home page Git Product logo

yolov9_deepsort's Introduction

Colab

YOLOv9_DeepSORT

This repository contains code for object detection and tracking in videos using the YOLOv9 object detection model and the DeepSORT algorithm.

Demo

demo blur

Installation

  1. Clone this repository:
 git clone https://github.com/sujanshresstha/YOLOv9_DeepSORT.git
 cd YOLOv9_DeepSORT
  1. Create new environment
  • Using Conda
conda env create -f conda.yml
conda activate yolov9-deepsort
  • Using pip
python3 -m virtualenv -p python3.11 yolov9-deepsort
source yolov9-deepsort/bin/activate
pip install -r requirements.txt
  1. Clone YOLOv9 repository:
 git clone https://github.com/WongKinYiu/yolov9.git
 cd yolov9
 pip install -r requirements.txt
 mv ../object_tracking.py ../yolov9
  1. Download model weight
 mkdir weights
 wget -P weights https://github.com/WongKinYiu/yolov9/releases/download/v0.1/yolov9-e.pt

Usage

  1. Prepare the video file:

    • Place the video file in the desired location.
    • Update the video flag in the path of the video file or set it to 0 to use the webcam as the input.
  2. Download YOLOv9 model:

    • Make sure the corresponding model weights are available.(YOLOv9-S/YOLOv9-M/YOLOv9-C/YOLOv9-E)
  3. Configure the output video:

    • Update output flag in the code to specify the path and filename of the output video file.
  4. Set the confidence threshold:

    • Adjust the conf flag in the code to set the confidence threshold for object detection. Objects with confidence below this threshold will be filtered out.
  5. If you want to detect and track certain object on video

    • Modify the class_id flag in the code to specify the class ID for detection. The default value of the flag is set to None. If you wish to detect and track only persons, set it to 0, or refer to the coco.names file for other options.
  6. If you want to blur certain object while tracking

    • Modify the bulr_id flag in the code to specify the class ID for detection. The default value of the flag is set to None.
  7. Run the code:

    # Run object tracking
    python object_tracking.py --video ./data/test.mp4 --output ./output/output.mp4
    
    # Run object tracking on webcam (set video flag to 0)
    python object_tracking.py --video 0 --output ./output/webcam.mp4
    
    # Run person tracking (set class_id flag to 0 for person)
    python object_tracking.py --video ./data/test.mp4 --output ./output/output.mp4 --class_id 0
    
    # Run tracking on a video with burring certain objects (set blur_id flag to 0 for person)
    python object_tracking.py --video ./data/test.mp4 --output ./output/output.mp4 --blur_id 0
    

Acknowledgements

  • This code is built upon the YOLOv9 model and the DeepSort algorithm.
  • Credits to the authors and contributors of the respective repositories used in this project.

References

yolov9_deepsort's People

Contributors

sujanshresstha avatar fukuda-a-hu 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.