autodistill-florence-2


Nameautodistill-florence-2 JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/autodistill/autodistill-florence-2
SummaryUse Florence 2 to auto-label data for use in training fine-tuned object detection models.
upload_time2024-06-19 14:36:46
maintainerNone
docs_urlNone
authorRoboflow
requires_python>=3.7
licenseNone
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?3"
      >
    </a>
  </p>
</div>

# Autodistill Florence 2 Module

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

[Florence 2](https://huggingface.co/microsoft/Florence-2-large), introduced in the paper [Florence-2: Advancing a Unified Representation for a Variety of Vision Tasks](https://arxiv.org/abs/2311.06242) is a multimodal vision model.

You can use Florence 2 to generate object detection annotations for use in training smaller object detection models with Autodistill.

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

Read the [Florence 2 Autodistill documentation](https://autodistill.github.io/autodistill/base_models/florence2/).

## Installation

To use Florence 2 with Autodistill, you need to install the following dependency:

```bash
pip3 install autodistill-florence-2
```

## Quickstart

```python
from autodistill_florence_2 import Florence2

# define an ontology to map class names to our Florence 2 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 = Florence2(
    ontology=CaptionOntology(
        {
            "person": "person",
            "a forklift": "forklift"
        }
    )
)
base_model.label("./context_images", extension=".jpeg")
```

## License

This project is licensed under an MIT license. See the [Florence 2 license](https://huggingface.co/microsoft/Florence-2-large) for more information about the Florence 2 model 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-florence-2",
    "name": "autodistill-florence-2",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Roboflow",
    "author_email": "support@roboflow.com",
    "download_url": "https://files.pythonhosted.org/packages/b0/8d/abee892bbce6e13ae2b30498eb115accd6ce5b3e8ef68b7e8886ea338d8a/autodistill_florence_2-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?3\"\n      >\n    </a>\n  </p>\n</div>\n\n# Autodistill Florence 2 Module\n\nThis repository contains the code supporting the CLIP base model for use with [Autodistill](https://github.com/autodistill/autodistill).\n\n[Florence 2](https://huggingface.co/microsoft/Florence-2-large), introduced in the paper [Florence-2: Advancing a Unified Representation for a Variety of Vision Tasks](https://arxiv.org/abs/2311.06242) is a multimodal vision model.\n\nYou can use Florence 2 to generate object detection annotations for use in training smaller object detection models with Autodistill.\n\nRead the full [Autodistill documentation](https://autodistill.github.io/autodistill/).\n\nRead the [Florence 2 Autodistill documentation](https://autodistill.github.io/autodistill/base_models/florence2/).\n\n## Installation\n\nTo use Florence 2 with Autodistill, you need to install the following dependency:\n\n```bash\npip3 install autodistill-florence-2\n```\n\n## Quickstart\n\n```python\nfrom autodistill_florence_2 import Florence2\n\n# define an ontology to map class names to our Florence 2 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 = Florence2(\n    ontology=CaptionOntology(\n        {\n            \"person\": \"person\",\n            \"a forklift\": \"forklift\"\n        }\n    )\n)\nbase_model.label(\"./context_images\", extension=\".jpeg\")\n```\n\n## License\n\nThis project is licensed under an MIT license. See the [Florence 2 license](https://huggingface.co/microsoft/Florence-2-large) for more information about the Florence 2 model 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": null,
    "summary": "Use Florence 2 to auto-label data for use in training fine-tuned object detection models.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/autodistill/autodistill-florence-2"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0bd2009ae9406d8190a2491aa86fee5099f885eb8bdf302e60b961c9af06e868",
                "md5": "a25dd5b2f29bb1f6baa65130cafa5340",
                "sha256": "b3e9f7ebe455d0d2537bac24f4032ce895958d972abf1721c8ccb9fe45595a77"
            },
            "downloads": -1,
            "filename": "autodistill_florence_2-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a25dd5b2f29bb1f6baa65130cafa5340",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 3830,
            "upload_time": "2024-06-19T14:36:44",
            "upload_time_iso_8601": "2024-06-19T14:36:44.453375Z",
            "url": "https://files.pythonhosted.org/packages/0b/d2/009ae9406d8190a2491aa86fee5099f885eb8bdf302e60b961c9af06e868/autodistill_florence_2-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b08dabee892bbce6e13ae2b30498eb115accd6ce5b3e8ef68b7e8886ea338d8a",
                "md5": "e83882917d8956b7828630fc7cb48f18",
                "sha256": "f2bc5e0135cd06de4cd7d62f64a30beb01978ea65f99351cb17cefc90a731319"
            },
            "downloads": -1,
            "filename": "autodistill_florence_2-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e83882917d8956b7828630fc7cb48f18",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 3692,
            "upload_time": "2024-06-19T14:36:46",
            "upload_time_iso_8601": "2024-06-19T14:36:46.138462Z",
            "url": "https://files.pythonhosted.org/packages/b0/8d/abee892bbce6e13ae2b30498eb115accd6ce5b3e8ef68b7e8886ea338d8a/autodistill_florence_2-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-19 14:36:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "autodistill",
    "github_project": "autodistill-florence-2",
    "github_not_found": true,
    "lcname": "autodistill-florence-2"
}
        
Elapsed time: 0.25163s