autodistill-gpt-4o


Nameautodistill-gpt-4o JSON
Version 0.1.5 PyPI version JSON
download
home_pagehttps://github.com/autodistill/autodistill-gpt-4o
SummaryGPT-4o model for use with Autodistill
upload_time2024-05-15 08:54:59
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"
      >
    </a>
  </p>
</div>

# Autodistill GPTo Module

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

[GPTo](https://openai.com/index/hello-gpt-4o/, developed by OpenAI, is a multi-modal language model that works across the image, text, and audio domains. With GPTo, you can ask questions about images in natural language. The `autodistill-gpt4o` module enables you to classify images using GPT-4V.

This model uses the [gpt-4-o API](https://platform.openai.com/docs/guides/vision) announced by OpenAI on May 13th, 2024.

> [!NOTE]  
> Using this project will incur billing charges for API calls to the OpenAI GPT-4 Vision API.
> Refer to the [OpenAI pricing](https://openai.com/pricing) page for more information and to calculate your expected pricing. This package makes one API call per image you want to label.

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

## Installation

To use GPT-4o with autodistill, you need to install the following dependency:


```bash
pip3 install autodistill-gpt-4o
```

## Quickstart

```python
from autodistill_gpt_4o import GPT4o

# define an ontology to map class names to our GPT-4o 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 = GPT4o(
    ontology=CaptionOntology(
        {
            "person": "person",
            "a forklift": "forklift"
        }
    ),
    api_key="OPENAI_API_KEY"
)
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-gpt-4o",
    "name": "autodistill-gpt-4o",
    "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/e1/53/071baecac133589e674e12f1fb4711f7c046f5c27cbe36712832f48d3929/autodistill_gpt_4o-0.1.5.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 GPTo Module\n\nThis repository contains the code supporting the GPTo base model for use with [Autodistill](https://github.com/autodistill/autodistill).\n\n[GPTo](https://openai.com/index/hello-gpt-4o/, developed by OpenAI, is a multi-modal language model that works across the image, text, and audio domains. With GPTo, you can ask questions about images in natural language. The `autodistill-gpt4o` module enables you to classify images using GPT-4V.\n\nThis model uses the [gpt-4-o API](https://platform.openai.com/docs/guides/vision) announced by OpenAI on May 13th, 2024.\n\n> [!NOTE]  \n> Using this project will incur billing charges for API calls to the OpenAI GPT-4 Vision API.\n> Refer to the [OpenAI pricing](https://openai.com/pricing) page for more information and to calculate your expected pricing. This package makes one API call per image you want to label.\n\nRead the full [Autodistill documentation](https://autodistill.github.io/autodistill/).\n\n## Installation\n\nTo use GPT-4o with autodistill, you need to install the following dependency:\n\n\n```bash\npip3 install autodistill-gpt-4o\n```\n\n## Quickstart\n\n```python\nfrom autodistill_gpt_4o import GPT4o\n\n# define an ontology to map class names to our GPT-4o 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 = GPT4o(\n    ontology=CaptionOntology(\n        {\n            \"person\": \"person\",\n            \"a forklift\": \"forklift\"\n        }\n    ),\n    api_key=\"OPENAI_API_KEY\"\n)\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": null,
    "summary": "GPT-4o model for use with Autodistill",
    "version": "0.1.5",
    "project_urls": {
        "Homepage": "https://github.com/autodistill/autodistill-gpt-4o"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e38ea693dc11f461d838893811a7e931ad76967f1bb6e43cbc1d6c77cf45de53",
                "md5": "8bc30c411fecfe4b42b74009f0498f09",
                "sha256": "45c2e1e03245b1836de8c063791f920b8aeee49984057ad765d5a33d50ce85a1"
            },
            "downloads": -1,
            "filename": "autodistill_gpt_4o-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8bc30c411fecfe4b42b74009f0498f09",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 5164,
            "upload_time": "2024-05-15T08:54:57",
            "upload_time_iso_8601": "2024-05-15T08:54:57.207999Z",
            "url": "https://files.pythonhosted.org/packages/e3/8e/a693dc11f461d838893811a7e931ad76967f1bb6e43cbc1d6c77cf45de53/autodistill_gpt_4o-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e153071baecac133589e674e12f1fb4711f7c046f5c27cbe36712832f48d3929",
                "md5": "a9dc8e24bf709c188e996ae8e480b2f5",
                "sha256": "a38600a23f0703ace8d4a9c66b573180acfeea5e4ab3f849783fa28b9e0c2205"
            },
            "downloads": -1,
            "filename": "autodistill_gpt_4o-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "a9dc8e24bf709c188e996ae8e480b2f5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4870,
            "upload_time": "2024-05-15T08:54:59",
            "upload_time_iso_8601": "2024-05-15T08:54:59.197336Z",
            "url": "https://files.pythonhosted.org/packages/e1/53/071baecac133589e674e12f1fb4711f7c046f5c27cbe36712832f48d3929/autodistill_gpt_4o-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-15 08:54:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "autodistill",
    "github_project": "autodistill-gpt-4o",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "autodistill-gpt-4o"
}
        
Elapsed time: 0.24253s