Skip to main content

fork of the official SAMv2 implementation with cpu support

Project description

Build and Tests

Installation

This is a CPU compatible fork of the official SAMv2 implementation. You can download it from pypi using pip as follows:

pip install samv2

Usage

After downloading the official weights, you can use the load_model() helper method to instantiate a model.

from sam2 import load_model

model = load_model(
    variant="tiny",
    ckpt_path="artifacts/sam2_hiera_tiny.pt",
    device="cpu"
)

Features 🚀

  • CPU compatible
  • ships with config files
  • Run image and video inference on CPUs

Citation

@article{ravi2024sam2,
  title={SAM 2: Segment Anything in Images and Videos},
  author={Ravi, Nikhila and Gabeur, Valentin and Hu, Yuan-Ting and Hu, Ronghang and Ryali, Chaitanya and Ma, Tengyu and Khedr, Haitham and R{\"a}dle, Roman and Rolland, Chloe and Gustafson, Laura and Mintun, Eric and Pan, Junting and Alwala, Kalyan Vasudev and Carion, Nicolas and Wu, Chao-Yuan and Girshick, Ross and Doll{\'a}r, Piotr and Feichtenhofer, Christoph},
  journal={arXiv preprint},
  year={2024}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

samv2-0.0.3.tar.gz (57.7 kB view details)

Uploaded Source

Built Distribution

samv2-0.0.3-py3-none-any.whl (72.4 kB view details)

Uploaded Python 3

File details

Details for the file samv2-0.0.3.tar.gz.

File metadata

  • Download URL: samv2-0.0.3.tar.gz
  • Upload date:
  • Size: 57.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.13

File hashes

Hashes for samv2-0.0.3.tar.gz
Algorithm Hash digest
SHA256 acebb79a878f5062350e83c4f6b07fbabc7a78e85351b5d951cc8cc7f47391d6
MD5 b362414a24ff4883deb26ba11baa7bb2
BLAKE2b-256 e1190fae6c81dd49b71e8974b6eaf1fdba5c41283a62844a349c646c4dccfe67

See more details on using hashes here.

File details

Details for the file samv2-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: samv2-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 72.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.13

File hashes

Hashes for samv2-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 929c384365a2a149ece6a6ca91bcb550b383d7f5e5c688747720bb7616991210
MD5 86aedfa3575bbb08ac021e7218ecd72b
BLAKE2b-256 36b185498471fc32ecec5963697f87bb17b3d29854a6010a113ecb92c7e4159d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page