autodistill-siglip


Nameautodistill-siglip JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/autodistill/autodistill-siglip
SummarySigLIP base model for use with Autodistill
upload_time2024-02-16 22:09:48
maintainer
docs_urlNone
authorRoboflow
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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 SigLIP Module

This repository contains the code supporting the SigLIP base model for use with [Autodistill](https://github.com/autodistill/autodistill).

[CLIP](https://github.com/openai/CLIP), developed by OpenAI, is a computer vision model trained using pairs of images and text. You can use CLIP with autodistill for image classification.

Read the full [Autodistill documentation](https://autodistill.github.io/autodistill/).

Read the [SigLIP Autodistill documentation](https://autodistill.github.io/autodistill/base_models/siglip/).

## Installation

To use SigLIP with autodistill, you need to install the following dependency:


```bash
pip3 install autodistill-clip
```

## Quickstart

```python
from autodistill_siglip import SigLIP
from autodistill.detection import CaptionOntology

# define an ontology to map class names to our SigLIP 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
labels = ["person", "a forklift"]
base_model = SigLIP(
    ontology=CaptionOntology({item: item for item in labels})
)

results = base_model.predict("image.jpeg", confidence=0.1)

top_1 = results.get_top_k(1)

# show top label
print(labels[top_1[0][0]])

# label folder of images
base_model.label("./context_images", extension=".jpeg")
```


## License

The SigLIP model is licensed under an [Apache 2.0 license](https://huggingface.co/google/siglip-base-patch16-224).

## 🏆 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-siglip",
    "name": "autodistill-siglip",
    "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/6b/78/5f4a460f23422b71b2cb40fc3166014494a0740ec1b8858c4c1ce407c8f7/autodistill-siglip-0.1.0.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 SigLIP Module\n\nThis repository contains the code supporting the SigLIP base model for use with [Autodistill](https://github.com/autodistill/autodistill).\n\n[CLIP](https://github.com/openai/CLIP), developed by OpenAI, is a computer vision model trained using pairs of images and text. You can use CLIP with autodistill for image classification.\n\nRead the full [Autodistill documentation](https://autodistill.github.io/autodistill/).\n\nRead the [SigLIP Autodistill documentation](https://autodistill.github.io/autodistill/base_models/siglip/).\n\n## Installation\n\nTo use SigLIP with autodistill, you need to install the following dependency:\n\n\n```bash\npip3 install autodistill-clip\n```\n\n## Quickstart\n\n```python\nfrom autodistill_siglip import SigLIP\nfrom autodistill.detection import CaptionOntology\n\n# define an ontology to map class names to our SigLIP 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\nlabels = [\"person\", \"a forklift\"]\nbase_model = SigLIP(\n    ontology=CaptionOntology({item: item for item in labels})\n)\n\nresults = base_model.predict(\"image.jpeg\", confidence=0.1)\n\ntop_1 = results.get_top_k(1)\n\n# show top label\nprint(labels[top_1[0][0]])\n\n# label folder of images\nbase_model.label(\"./context_images\", extension=\".jpeg\")\n```\n\n\n## License\n\nThe SigLIP model is licensed under an [Apache 2.0 license](https://huggingface.co/google/siglip-base-patch16-224).\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": "SigLIP base model for use with Autodistill",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/autodistill/autodistill-siglip"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1a7b016a0add64cb005eab853d3370f68e0ffc2a4d0b200f925e83cff5f8f961",
                "md5": "092d5c91f01143ddebfbd242e6f6d687",
                "sha256": "2815075ea1fb39b21c0a18246285efebcc260e7b5695f5f5b7853cdca9d77c95"
            },
            "downloads": -1,
            "filename": "autodistill_siglip-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "092d5c91f01143ddebfbd242e6f6d687",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 3293,
            "upload_time": "2024-02-16T22:09:46",
            "upload_time_iso_8601": "2024-02-16T22:09:46.261409Z",
            "url": "https://files.pythonhosted.org/packages/1a/7b/016a0add64cb005eab853d3370f68e0ffc2a4d0b200f925e83cff5f8f961/autodistill_siglip-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b785f4a460f23422b71b2cb40fc3166014494a0740ec1b8858c4c1ce407c8f7",
                "md5": "4eea9d615bb45bccbb0b1d6596d39ff6",
                "sha256": "cdc3f60d855550e20908fdf9c3e6c8cb68085c32d7363f9ace06a32868f8e072"
            },
            "downloads": -1,
            "filename": "autodistill-siglip-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4eea9d615bb45bccbb0b1d6596d39ff6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4037,
            "upload_time": "2024-02-16T22:09:48",
            "upload_time_iso_8601": "2024-02-16T22:09:48.279336Z",
            "url": "https://files.pythonhosted.org/packages/6b/78/5f4a460f23422b71b2cb40fc3166014494a0740ec1b8858c4c1ce407c8f7/autodistill-siglip-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-16 22:09:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "autodistill",
    "github_project": "autodistill-siglip",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "autodistill-siglip"
}
        
Elapsed time: 0.63361s