Skip to content

ahany42/Object-Tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Object Tracking with SAM + MeanShift

This project implements single object tracking using a combination of Segment Anything Model (SAM) for segmentation and MeanShift for tracking.
It includes:

  • Color‑based segmentation tracking
  • SAM‑assisted segmentation with MeanShift tracking
  • Hue‑based and brightness‑based tracking strategies
  • Backprojection visualization for tracking debugging

🧠 Features

  • Color segmentation tracking (tracks blue objects without SAM/MeanShift)
  • 🔍 Segmentation + MeanShift tracking using Segment Anything Model (SAM)
  • ☀️ Hue‑based and brightness/V‑channel‑based tracking (for dark/black objects)
  • 📹 Displays original frames with bounding boxes and backprojection maps

🚀 Getting Started

1. Clone the repository

git clone https://github.com/ahany42/Object-Tracking.git
cd Object-Tracking

2. Create a Python environment

python -m venv venv
source venv/bin/activate    # macOS / Linux
venv\Scripts\activate       # Windows

3. Install dependencies

pip install -r requirements.txt

4. Download SAM model weights (Large file)

The SAM model weights are too large to include in this repo. Download the ViT‑B SAM checkpoint and place it in the project folder (or update your paths in the code):

📌 SAM ViT‑B Checkpoint sam_vit_b_01ec64.pth Download from the official Segment Anything model releases.


Object Tracking with SAM + MeanShift

This project implements single object tracking using a combination of Segment Anything Model (SAM) for segmentation and MeanShift for tracking.
It includes:

  • Color‑based segmentation tracking
  • SAM‑assisted segmentation with MeanShift tracking
  • Hue‑based and brightness‑based tracking strategies
  • Backprojection visualization for tracking debugging

🧠 Features

  • Color segmentation tracking (tracks blue objects without SAM/MeanShift)
  • 🔍 Segmentation + MeanShift tracking using Segment Anything Model (SAM)
  • ☀️ Hue‑based and brightness/V‑channel‑based tracking (for dark/black objects)
  • 📹 Displays original frames with bounding boxes and backprojection maps

🚀 Getting Started

1. Clone the repository

git clone https://github.com/ahany42/Object-Tracking.git
cd Object-Tracking

2. Create a Python environment

python -m venv venv
source venv/bin/activate    # macOS / Linux
venv\Scripts\activate       # Windows

3. Install dependencies

pip install -r requirements.txt

4. Download SAM model weights (Large file)

The SAM model weights are too large to include in this repo. Download the ViT‑B SAM checkpoint and place it in the project folder (or update your paths in the code):

📌 SAM ViT‑B Checkpoint sam_vit_b_01ec64.pth Download from the official Segment Anything model releases.


Sample Run

Loading ....

Sample Output

About

Video Tracking using SAM and Mean Shift

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages