<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 EfficientYOLOWorld Module
This repository contains the code supporting the EfficientYOLOWorld base model for use with [Autodistill](https://github.com/autodistill/autodistill).
EfficientYOLOWorld is a combination of two models:
1. YOLO-World, a zero-shot object detection model, and;
2. EfficientSAM, an image segmentation model.
This model runs EfficientSAM on each bounding box region generated by YOLO-World. This allows you to retrieve both the bounding box and the segmentation mask for each object of interest in an image.
Read the full [Autodistill documentation](https://autodistill.github.io/autodistill/).
Read the [EfficientYOLOWorld Autodistill documentation](https://autodistill.github.io/autodistill/base_models/efficient_yolo_world/).
## Installation
To use EfficientYOLOWorld with autodistill, you need to install the following dependency:
```bash
pip3 install autodistill-efficient-yolo-world
```
## Quickstart
```python
from autodistill_efficient_yolo_world import EfficientYOLOWorld
from autodistill.detection import CaptionOntology
import cv2
import supervision as sv
# define an ontology to map class names to our EfficientYOLOWorld 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 = EfficientYOLOWorld(ontology=CaptionOntology({"book": "book"}))
# predict on an image
result = base_model.predict("bookshelf.jpeg", confidence=0.1)
image = cv2.imread("bookshelf.jpeg")
mask_annotator = sv.MaskAnnotator()
annotated_frame = mask_annotator.annotate(
scene=image.copy(),
detections=result,
)
sv.plot_image(annotated_frame)
base_model.label("./context_images", extension=".jpeg")
```
## License
EfficientSAM is licensed under an [Apache 2.0 license](EFFICIENT_SAM_LICENSE).
YOLO-World is licensed under a [GPL-3.0 license](YOLO_WORLD_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/roboflow/autodistill-efficient-yolo-world",
"name": "autodistill-efficient-yolo-world",
"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/63/2f/145af030407771d48be1bb862a9fc6efdba085376bee681dd74fbe85df4d/autodistill-efficient-yolo-world-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 EfficientYOLOWorld Module\n\nThis repository contains the code supporting the EfficientYOLOWorld base model for use with [Autodistill](https://github.com/autodistill/autodistill).\n\nEfficientYOLOWorld is a combination of two models:\n\n1. YOLO-World, a zero-shot object detection model, and;\n2. EfficientSAM, an image segmentation model.\n\nThis model runs EfficientSAM on each bounding box region generated by YOLO-World. This allows you to retrieve both the bounding box and the segmentation mask for each object of interest in an image.\n\nRead the full [Autodistill documentation](https://autodistill.github.io/autodistill/).\n\nRead the [EfficientYOLOWorld Autodistill documentation](https://autodistill.github.io/autodistill/base_models/efficient_yolo_world/).\n\n## Installation\n\nTo use EfficientYOLOWorld with autodistill, you need to install the following dependency:\n\n\n```bash\npip3 install autodistill-efficient-yolo-world\n```\n\n## Quickstart\n\n```python\nfrom autodistill_efficient_yolo_world import EfficientYOLOWorld\nfrom autodistill.detection import CaptionOntology\nimport cv2\nimport supervision as sv\n\n# define an ontology to map class names to our EfficientYOLOWorld 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 = EfficientYOLOWorld(ontology=CaptionOntology({\"book\": \"book\"}))\n\n# predict on an image\nresult = base_model.predict(\"bookshelf.jpeg\", confidence=0.1)\n\nimage = cv2.imread(\"bookshelf.jpeg\")\n\nmask_annotator = sv.MaskAnnotator()\nannotated_frame = mask_annotator.annotate(\n\tscene=image.copy(),\n\tdetections=result,\n)\n\nsv.plot_image(annotated_frame)\n\nbase_model.label(\"./context_images\", extension=\".jpeg\")\n```\n\n\n## License\n\nEfficientSAM is licensed under an [Apache 2.0 license](EFFICIENT_SAM_LICENSE).\n\nYOLO-World is licensed under a [GPL-3.0 license](YOLO_WORLD_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": "EfficientSAM + YOLO-World base model for use with Autodistill",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/roboflow/autodistill-efficient-yolo-world"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6bdec28b11dead9f88ea3551ef11b477fd286f130a1654e4f2619e801777e5e3",
"md5": "0bc0fa5485f6bd95c25bd2083f0d57af",
"sha256": "ef631c6f1413c4c66d66ae7c94675d3613a63d777f7d849e0955b55fe45494b2"
},
"downloads": -1,
"filename": "autodistill_efficient_yolo_world-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0bc0fa5485f6bd95c25bd2083f0d57af",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 3639,
"upload_time": "2024-02-21T09:31:13",
"upload_time_iso_8601": "2024-02-21T09:31:13.165321Z",
"url": "https://files.pythonhosted.org/packages/6b/de/c28b11dead9f88ea3551ef11b477fd286f130a1654e4f2619e801777e5e3/autodistill_efficient_yolo_world-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "632f145af030407771d48be1bb862a9fc6efdba085376bee681dd74fbe85df4d",
"md5": "c2b60140b7084c6ae6ca90b97662d47f",
"sha256": "a23f90388868e5d1f40482e85a64e5753d24e88f3e38c70231b9657e2eca0bca"
},
"downloads": -1,
"filename": "autodistill-efficient-yolo-world-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "c2b60140b7084c6ae6ca90b97662d47f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 5726,
"upload_time": "2024-02-21T09:31:15",
"upload_time_iso_8601": "2024-02-21T09:31:15.148632Z",
"url": "https://files.pythonhosted.org/packages/63/2f/145af030407771d48be1bb862a9fc6efdba085376bee681dd74fbe85df4d/autodistill-efficient-yolo-world-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-21 09:31:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "roboflow",
"github_project": "autodistill-efficient-yolo-world",
"github_not_found": true,
"lcname": "autodistill-efficient-yolo-world"
}