Skip to main content

Open In Colab Build and Tests

CPU compatible fork of the official SAMv2 implementation with webcam support.

Features 🚀

  • CPU compatible
  • ships with config files
  • Run image and video, and webcam inference on CPUs
  • Example notebooks showcasing inference using weights and biases.

Installation

You can download it from pypi using pip as follows:

pip install samv2-webcam

or from the repository:

pip install git+https://github.com/sonnyky/samv2.git

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"
)
  • Open In Colab Example Notebook to run prompted segmentation on images logging predictions as W&B Tables.
  • Open In Colab Example Notebook to run automatic segmentation on images logging predictions as W&B Tables.

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}
}

Metadata

Release files for samv2-webcam 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for samv2-webcam 0.0.3
File Size Uploaded Provenance Actions
samv2_webcam-0.0.3.tar.gz 69.5 kB Without provenance Details for samv2_webcam-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for samv2-webcam 0.0.3
File Interpreter ABI Platform Actions
samv2_webcam-0.0.3-py3-none-any.whl Python 3 none any Details for samv2_webcam-0.0.3-py3-none-any.whl

Total release size: 155.5 kB

Release files / samv2_webcam-0.0.3.tar.gz

Download URL samv2_webcam-0.0.3.tar.gz
Size 69.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ee3b39ee8c71d83c66836f1baf6e61f49a83f9e271a1d05c3fc1f9130d3f4582
BLAKE2b-256 checksum
How to use checksums
b4b6cf740481d42290a6884a21f540db94671086fd9a16e23163ed49e87ef704
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.3

Release files / samv2_webcam-0.0.3-py3-none-any.whl

Download URL samv2_webcam-0.0.3-py3-none-any.whl
Size 86.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a1e302b2aa023db7362a57531ac64984a17f80345c35bf80a3c1e0abec00515
BLAKE2b-256 checksum
How to use checksums
c109d4a3478e0070b42b12865b13eb6907238e4150cab1cc4ddb3871d2e29fcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.3

Security for samv2-webcam 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page