<div align="center">
<h2>
MetaSam: Packaged version of the Segment Anything 2 Model
</h2>
<div>
<img width="500" alt="teaser" src="doc/assets/logo.png">
</div>
<div>
<a href="https://pypi.org/project/metasam" target="_blank">
<img src="https://img.shields.io/pypi/pyversions/metasam.svg?color=%2334D058" alt="Supported Python versions">
</a>
<a href="https://badge.fury.io/py/metasam"><img src="https://badge.fury.io/py/metasam.svg" alt="pypi version"></a>
</div>
</div>
## 🛠️ Installation
```bash
pip install metasam
```
## 🤗 Model Hub
```bash
bash script/download_model.sh
```
## ⭐ Usage
```python
from metasam import SAM2Wrapper
# Initialize SAM2Wrapper
sam = SAM2Wrapper("path/to/checkpoint", "path/to/config")
# Load an image
sam.set_image("path/to/your/image.jpg")
# Predict segmentation
masks, scores, logits = sam.predict(point_coords=[[500, 640]], point_labels=[1])
# Visualize results
sam.show_masks(masks, scores)
```
## 😍 Contributing
```bash
pip install pre-commit
pre-commit install
pre-commit run --all-files
```
## 📜 License
This project is licensed under the terms of the Apache License 2.0.
## 🤗 Citation
```bibtex
@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 arXiv:2408.00714},
url={https://arxiv.org/abs/2408.00714},
year={2024}
}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/kadirnar/metasam",
"name": "metasam",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "kadirnar",
"author_email": "kadir.nar@hotmail.com",
"download_url": "https://files.pythonhosted.org/packages/a2/62/c5878d8396a5e41cabfa1a863f865249af4b7e5dc245f59488e7b90498ae/metasam-0.0.3.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n<h2>\n MetaSam: Packaged version of the Segment Anything 2 Model\n</h2>\n<div>\n <img width=\"500\" alt=\"teaser\" src=\"doc/assets/logo.png\">\n</div>\n<div>\n <a href=\"https://pypi.org/project/metasam\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/pyversions/metasam.svg?color=%2334D058\" alt=\"Supported Python versions\">\n </a>\n <a href=\"https://badge.fury.io/py/metasam\"><img src=\"https://badge.fury.io/py/metasam.svg\" alt=\"pypi version\"></a>\n</div>\n</div>\n\n## \ud83d\udee0\ufe0f Installation\n\n```bash\npip install metasam\n```\n\n## \ud83e\udd17 Model Hub\n\n```bash\nbash script/download_model.sh\n```\n\n## \u2b50 Usage\n\n```python\nfrom metasam import SAM2Wrapper\n\n# Initialize SAM2Wrapper\nsam = SAM2Wrapper(\"path/to/checkpoint\", \"path/to/config\")\n\n# Load an image\nsam.set_image(\"path/to/your/image.jpg\")\n\n# Predict segmentation\nmasks, scores, logits = sam.predict(point_coords=[[500, 640]], point_labels=[1])\n\n# Visualize results\nsam.show_masks(masks, scores)\n```\n\n## \ud83d\ude0d Contributing\n\n```bash\npip install pre-commit\npre-commit install\npre-commit run --all-files\n```\n\n## \ud83d\udcdc License\n\nThis project is licensed under the terms of the Apache License 2.0.\n\n## \ud83e\udd17 Citation\n\n```bibtex\n@article{ravi2024sam2,\n title={SAM 2: Segment Anything in Images and Videos},\n 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},\n journal={arXiv preprint arXiv:2408.00714},\n url={https://arxiv.org/abs/2408.00714},\n year={2024}\n}\n```\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Metasam A Python package for Inference SAM",
"version": "0.0.3",
"project_urls": {
"Homepage": "https://github.com/kadirnar/metasam"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a262c5878d8396a5e41cabfa1a863f865249af4b7e5dc245f59488e7b90498ae",
"md5": "e1ad10311aa3639c238d2673f572fae1",
"sha256": "2c91e985158fdf40439266c46579671545114b5243388c526bc4e08c2d874616"
},
"downloads": -1,
"filename": "metasam-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "e1ad10311aa3639c238d2673f572fae1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 64919,
"upload_time": "2024-08-07T15:21:18",
"upload_time_iso_8601": "2024-08-07T15:21:18.086637Z",
"url": "https://files.pythonhosted.org/packages/a2/62/c5878d8396a5e41cabfa1a863f865249af4b7e5dc245f59488e7b90498ae/metasam-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-07 15:21:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kadirnar",
"github_project": "metasam",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "metasam"
}