How sujanshresstha/yolov9_deepsort works
Project type and purpose
• This is a Python-based computer vision pipeline for real-time object detection and tracking in videos. It combines two main algorithms:
• YOLOv9 for object detection
• DeepSORT for multi-object tracking
• The end-goal is to take a video (or webcam feed), run detection and tracking, optionally blur certain classes, and output an annotated video file.
File structure
• Top level:
• README.md, conda.yml, requirements.txt – setup and documentation
• YOLOv9_DeepSORT.ipynb – interactive demo/notebook
• object_tracking.py – main entry point script
• configs/ – contains class labels (coco.names)
• data/ – sample videos and helper GIFs
• External dependency: You clone the separate yolov9 repo into this folder, install its requirements, and move object_tracking.py there.
• No separate frontend/backend; it’s a single-process pipeline with reusable modules.
README for additional insights
• Describes installation steps, usage flags, and demo outputs
• Notes how to plug into webcam vs. file, adjust confidences, class filters, blur settings
• Acknowledges underlying YOLOv9 repo and DeepSORT algorithm
a. Main components:
1. Input Loader
– Source: video file or webcam
2. Configuration Module
– Loads flags (video path, conf threshold, class_id, blur_id)
– Reads coco.names from configs/
3. YOLOv9 Inference Engine
– Loads pre-trained .pt weights
4. DeepSORT Tracker
– Initializes tracker, feature extractor
– Associates detections across frames → object IDs
5. Post-processing / Blur Module
6. Output Writer
– Writes frames into output video file
7. (Optional) Notebook Interface
– Provides an interactive demo environment
b. Relationships & data flow:
Input Loader → Configuration Module →
→ YOLOv9 Engine → raw detections → DeepSORT → tracked detections
→ Post-processing/Blur → Annotated frames → Output Writer
c. Architectural patterns & design principles:
– Single process pipeline: sequential flow per frame
– Modular separation: detection vs. tracking vs. visualization
– Config-driven: flags control behavior, external coco.names file
– Reuse of external repos (yolov9, deepsort)
d. Key technologies:
– Python 3.11 environment (conda.yml or pip)
– PyTorch (YOLOv9 implementation)
– NumPy/OpenCV (frame handling, drawing)
– DeepSORT (tracking algorithm, feature extractor)