<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 VLPart Module
This repository contains the code supporting the VLPart base model for use with [Autodistill](https://github.com/autodistill/autodistill).
[VLPart](https://github.com/facebookresearch/VLPart), developed by Meta Research, is an object detection and segmentation model that works with an open vocabulary. `autodistill-vlpart` enables you to use VLPart to auto-label images for use in training a fine-tuned model. `autodistill-vlpart` supports the LVIS vocabulary.
Read the full [Autodistill documentation](https://autodistill.github.io/autodistill/).
Read the [VLPart Autodistill documentation](https://autodistill.github.io/autodistill/base_models/vlpart/).
## Installation
To use VLPart with autodistill, you need to install the following dependency:
```bash
pip3 install autodistill-vlpart
```
## Quickstart
```python
from autodistill_vlpart import VLPart
from autodistill.detection import CaptionOntology
from autodistill.utils import plot
# define an ontology to map class names to our VLPart 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 = VLPart(
ontology=CaptionOntology(
{
"person": "person"
}
)
)
predictions = base_model.predict("./image.png")
print(predictions)
plot(
image=cv2.imread("./image.png"),
classes=base_model.class_names,
detections=predictions
)
# label the images in the context_images folder
base_model.label("./context_images", extension=".jpeg")
```
## License
This project is licensed under an [MIT 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-vlpart",
"name": "autodistill-vlpart",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Roboflow",
"author_email": "support@roboflow.vom",
"download_url": "https://files.pythonhosted.org/packages/c1/aa/cfc7af01673490c6ed3103692e7d941e44e2013d84d5e2bdb7e2439bcb96/autodistill-vlpart-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 VLPart Module\n\nThis repository contains the code supporting the VLPart base model for use with [Autodistill](https://github.com/autodistill/autodistill).\n\n[VLPart](https://github.com/facebookresearch/VLPart), developed by Meta Research, is an object detection and segmentation model that works with an open vocabulary. `autodistill-vlpart` enables you to use VLPart to auto-label images for use in training a fine-tuned model. `autodistill-vlpart` supports the LVIS vocabulary.\n\nRead the full [Autodistill documentation](https://autodistill.github.io/autodistill/).\n\nRead the [VLPart Autodistill documentation](https://autodistill.github.io/autodistill/base_models/vlpart/).\n\n## Installation\n\nTo use VLPart with autodistill, you need to install the following dependency:\n\n```bash\npip3 install autodistill-vlpart\n```\n\n## Quickstart\n\n```python\nfrom autodistill_vlpart import VLPart\nfrom autodistill.detection import CaptionOntology\nfrom autodistill.utils import plot\n\n# define an ontology to map class names to our VLPart 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 = VLPart(\n ontology=CaptionOntology(\n {\n \"person\": \"person\"\n }\n )\n)\n\npredictions = base_model.predict(\"./image.png\")\n\nprint(predictions)\n\nplot(\n image=cv2.imread(\"./image.png\"),\n classes=base_model.class_names,\n detections=predictions\n)\n\n# label the images in the context_images folder\nbase_model.label(\"./context_images\", extension=\".jpeg\")\n```\n\n## License\n\nThis project is licensed under an [MIT 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": "VLPart for use with Autodistill",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/autodistill/autodistill-vlpart"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f3f8933068dd0380eb0565b409490b8f54ab4c37599dd8020c6b484368cb8042",
"md5": "45bc44069c5fd1e21650c1ed7dce7011",
"sha256": "8b2c5f7684d23e67d617ba1e1549816081e609ca34035d18b0ab03b91c81252a"
},
"downloads": -1,
"filename": "autodistill_vlpart-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "45bc44069c5fd1e21650c1ed7dce7011",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 10610,
"upload_time": "2023-12-06T11:03:21",
"upload_time_iso_8601": "2023-12-06T11:03:21.267249Z",
"url": "https://files.pythonhosted.org/packages/f3/f8/933068dd0380eb0565b409490b8f54ab4c37599dd8020c6b484368cb8042/autodistill_vlpart-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c1aacfc7af01673490c6ed3103692e7d941e44e2013d84d5e2bdb7e2439bcb96",
"md5": "9a13e01b44fecbc77d274ba404228c64",
"sha256": "d9c54dc970ac84ae2847c7dcf7b8ad3176e95b9430f5f39ecabda7916eae124f"
},
"downloads": -1,
"filename": "autodistill-vlpart-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "9a13e01b44fecbc77d274ba404228c64",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 10655,
"upload_time": "2023-12-06T11:03:26",
"upload_time_iso_8601": "2023-12-06T11:03:26.817560Z",
"url": "https://files.pythonhosted.org/packages/c1/aa/cfc7af01673490c6ed3103692e7d941e44e2013d84d5e2bdb7e2439bcb96/autodistill-vlpart-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-06 11:03:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "autodistill",
"github_project": "autodistill-vlpart",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "autodistill-vlpart"
}