Skip to content

Video Vehicle Segmentation project made with META's Segment Anything Model 2 (SAM2)

Notifications You must be signed in to change notification settings

eldan1z/video-segmentation-sam2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vehicle Segmentation from Videos using SAM2 Model

This project uses the SAM2 model for vehicle segmentation from videos. It involves extracting frames from videos and detecting vehicles from these frames. The SAM2 model provides state-of-the-art segmentation capabilities, making it ideal for tasks that require precise object segmentation.

Features

  • Frame Extraction: Extracts every frame from a video file and saves them as individual .jpg files.
  • Vehicle Detection: Segments vehicles from multiple frames using the SAM2 model.

Installation

First you have to build SAM2 from source

  git clone git clone https://github.com/facebookresearch/segment-anything-2.git
  cd segment-anything-2
  pip install -e .

Second, install the required packages:

  pip install -r requirements.txt

Usage

  1. Install checkpoint file:
  wget https://dl.fbaipublicfiles.com/segment_anything_2/072824/sam2_hiera_large.pt
  1. Run the script for frame extraction:
  python main.py --video_path <path_to_video>
  1. You can find notebooks for video segmentation in src folder.

About

Video Vehicle Segmentation project made with META's Segment Anything Model 2 (SAM2)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published