This is an implementation of SAM2 model (original repository by Meta).
-
Install prerequisites:
python3 -m pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl
-
Retrieve the images and the checkpoint:
python3 download_test_data.py sh checkpoints/download_ckpt.sh
-
Run the example:
python3 image_demo.py
-
Run the example:
python3 video_demo.py
The SAM2 model checkpoints and associated model code are sourced from Meta's SAM2 repository and are licensed under the Apache 2.0 license (included as LICENSE_sam2 in our sample).