CPU compatible fork of the official SAMv2 implementation with Webcam support
Project description
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"
)
Example Notebook to run prompted segmentation on images logging predictions as W&B Tables.
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}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file samv2_webcam-0.0.3.tar.gz.
File metadata
- Download URL: samv2_webcam-0.0.3.tar.gz
- Upload date:
- Size: 69.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee3b39ee8c71d83c66836f1baf6e61f49a83f9e271a1d05c3fc1f9130d3f4582
|
|
| MD5 |
1f51d9cc5f963f43c91a97a0be928120
|
|
| BLAKE2b-256 |
b4b6cf740481d42290a6884a21f540db94671086fd9a16e23163ed49e87ef704
|
File details
Details for the file samv2_webcam-0.0.3-py3-none-any.whl.
File metadata
- Download URL: samv2_webcam-0.0.3-py3-none-any.whl
- Upload date:
- Size: 86.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a1e302b2aa023db7362a57531ac64984a17f80345c35bf80a3c1e0abec00515
|
|
| MD5 |
d4a54f691ee5987053f246ec869ac4ca
|
|
| BLAKE2b-256 |
c109d4a3478e0070b42b12865b13eb6907238e4150cab1cc4ddb3871d2e29fcc
|