Skip to content

Combining OSTrack and Segment Anything for VOT and VOS

License

Notifications You must be signed in to change notification settings

yahooo-m/OSTrack_SAM

Repository files navigation

OSTrack_SAM

A demo combining OSTrack and Segment Anything for VOT and VOS. Still update!!

Some Result

image

Quick start

Install the environment

Option1: Use the Anaconda (CUDA 10.2)

conda create -n ostrack python=3.8
conda activate ostrack
bash install.sh

Option2: Use the Anaconda (CUDA 11.3)

conda env create -f ostrack_cuda113_env.yaml

Install Segment Anything:

python -m pip install -e segment_anything

Follow the OSTrack to set project paths

Run the following command to set paths for this project

python tracking/create_default_local_file.py --workspace_dir . --data_dir ./data --save_dir ./output

After running this command, you can also modify paths by editing these two files

lib/train/admin/local.py  # paths about training
lib/test/evaluation/local.py  # paths about testing

Data Preparation

Put the tracking datasets in ./data. It should look like:

${PROJECT_ROOT}
 -- data
     -- lasot
         |-- airplane
         |-- basketball
         |-- bear
         ...
     -- got10k
         |-- test
         |-- train
         |-- val
     -- coco
         |-- annotations
         |-- images
     -- trackingnet
         |-- TRAIN_0
         |-- TRAIN_1
         ...
         |-- TRAIN_11
         |-- TEST

And you can set your own datasets

model preperation

  • Download the OSTrack model weights from Google Drive

    Put the downloaded weights on $PROJECT_ROOT$/output/checkpoints/train/ostrack

  • Download the checkpoint for segment-anything and grounding-dino:

cd OSTrack_SAM

wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth

Run demo

  • Run Demo
export CUDA_VISIBLE_DEVICES=0
python tracking_sam_demo.py \
   ostrack \
  vitb_384_mae_ce_32x4_got10k_ep100 \
  --dataset got10k_val \
  --threads 4 \
  --num_gpus 1 \
  --checkpoint sam_vit_h_4b8939.pth \
  --sequence (any sequence in datasets)\

Thanks OSTrack and other awesome SAM projects:

About

Combining OSTrack and Segment Anything for VOT and VOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published