<div align="center">
<p>
<a align="center" href="" target="_blank">
<img
width="850"
src="https://media.roboflow.com/open-source/autodistill/autodistill-banner.png"
>
</a>
</p>
</div>
# Autodistill FastSAM Module
This repository contains the code supporting the FastSAM base model for use with [Autodistill](https://github.com/autodistill/autodistill).
[FastSAM](https://github.com/CASIA-IVA-Lab/FastSAM) is a segmentation model trained on 2% of the SA-1B dataset used to train the [Segment Anything Model](https://github.com/facebookresearch/segment-anything).
Read the full [Autodistill documentation](https://autodistill.github.io/autodistill/).
Read the [FastSAM Autodistill documentation](https://autodistill.github.io/autodistill/base_models/fastsam/).
## Installation
To use FastSAM with autodistill, you need to install the following dependency:
```bash
pip3 install autodistill-fastsam
```
## Quickstart
> [!NOTE]
> When you first run this model, the installation process will start. Inference may take a few seconds (in testing, up to 30 seconds) while the model is downloaded and installed. Once the model is installed, inference will be much faster.
```python
from autodistill_fastsam import FastSAM
# define an ontology to map class names to our FastSAM prompt
# the ontology dictionary has the format {caption: class}
# where caption is the prompt sent to the base model, and class is the label that will
# be saved for that caption in the generated annotations
# then, load the model
base_model = FastSAM(
ontology=CaptionOntology(
{
"person": "person",
"a forklift": "forklift"
}
)
)
base_model.label("./context_images", extension=".jpeg")
```
## License
This project is licensed under an [Apache 2.0 license](LICENSE).
## 🏆 Contributing
We love your input! Please see the core Autodistill [contributing guide](https://github.com/autodistill/autodistill/blob/main/CONTRIBUTING.md) to get started. Thank you 🙏 to all our contributors!
Raw data
{
"_id": null,
"home_page": "https://github.com/autodistill/autodistill-fastsam",
"name": "autodistill-fastsam",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Roboflow",
"author_email": "support@roboflow.com",
"download_url": "https://files.pythonhosted.org/packages/da/a8/ef8366ea661d09a938428b74d7a878a62520b5956b827b2191a66c1cbbcc/autodistill-fastsam-0.1.1.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n <p>\n <a align=\"center\" href=\"\" target=\"_blank\">\n <img\n width=\"850\"\n src=\"https://media.roboflow.com/open-source/autodistill/autodistill-banner.png\"\n >\n </a>\n </p>\n</div>\n\n# Autodistill FastSAM Module\n\nThis repository contains the code supporting the FastSAM base model for use with [Autodistill](https://github.com/autodistill/autodistill).\n\n[FastSAM](https://github.com/CASIA-IVA-Lab/FastSAM) is a segmentation model trained on 2% of the SA-1B dataset used to train the [Segment Anything Model](https://github.com/facebookresearch/segment-anything).\n\nRead the full [Autodistill documentation](https://autodistill.github.io/autodistill/).\n\nRead the [FastSAM Autodistill documentation](https://autodistill.github.io/autodistill/base_models/fastsam/).\n\n## Installation\n\nTo use FastSAM with autodistill, you need to install the following dependency:\n\n```bash\npip3 install autodistill-fastsam\n```\n\n## Quickstart\n\n> [!NOTE]\n\n> When you first run this model, the installation process will start. Inference may take a few seconds (in testing, up to 30 seconds) while the model is downloaded and installed. Once the model is installed, inference will be much faster.\n\n```python\nfrom autodistill_fastsam import FastSAM\n\n# define an ontology to map class names to our FastSAM prompt\n# the ontology dictionary has the format {caption: class}\n# where caption is the prompt sent to the base model, and class is the label that will\n# be saved for that caption in the generated annotations\n# then, load the model\nbase_model = FastSAM(\n ontology=CaptionOntology(\n {\n \"person\": \"person\",\n \"a forklift\": \"forklift\"\n }\n )\n)\nbase_model.label(\"./context_images\", extension=\".jpeg\")\n```\n\n\n## License\n\nThis project is licensed under an [Apache 2.0 license](LICENSE).\n\n## \ud83c\udfc6 Contributing\n\nWe love your input! Please see the core Autodistill [contributing guide](https://github.com/autodistill/autodistill/blob/main/CONTRIBUTING.md) to get started. Thank you \ud83d\ude4f to all our contributors!\n",
"bugtrack_url": null,
"license": "",
"summary": "FastSAM module for use with Autodistill",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/autodistill/autodistill-fastsam"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f5616d32300564997ac95de1b30246e80737a20a66e58f688d7baf95cb6b5466",
"md5": "2896faf2d9de936c94924ef1778f5543",
"sha256": "633c2f28390095baa91c3aeed7f69ad17cb38896c6831f9da9ad96086901fa4c"
},
"downloads": -1,
"filename": "autodistill_fastsam-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2896faf2d9de936c94924ef1778f5543",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 8929,
"upload_time": "2023-12-06T09:38:21",
"upload_time_iso_8601": "2023-12-06T09:38:21.655416Z",
"url": "https://files.pythonhosted.org/packages/f5/61/6d32300564997ac95de1b30246e80737a20a66e58f688d7baf95cb6b5466/autodistill_fastsam-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "daa8ef8366ea661d09a938428b74d7a878a62520b5956b827b2191a66c1cbbcc",
"md5": "203237de037c541caae25da2fe316797",
"sha256": "87aad8b2ae9f6ec785bf43a21c5ec651e3eb483fca30692733f6eb97a85e7c39"
},
"downloads": -1,
"filename": "autodistill-fastsam-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "203237de037c541caae25da2fe316797",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 8240,
"upload_time": "2023-12-06T09:38:23",
"upload_time_iso_8601": "2023-12-06T09:38:23.015962Z",
"url": "https://files.pythonhosted.org/packages/da/a8/ef8366ea661d09a938428b74d7a878a62520b5956b827b2191a66c1cbbcc/autodistill-fastsam-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-06 09:38:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "autodistill",
"github_project": "autodistill-fastsam",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "autodistill-fastsam"
}