Skip to main content

Autodistill CLIP Module

This repository contains the code supporting the CLIP base model for use with Autodistill.

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.

Read the CLIP Autodistill documentation.

Installation

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

pip3 install autodistill-clip

Quickstart

from autodistill_clip import CLIP
from autodistill.detection import CaptionOntology

# define an ontology to map class names to our CLIP 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 = CLIP(
    ontology=CaptionOntology(
        {
            "person": "person",
            "a forklift": "forklift"
        }
    )
)

results = base_model.predict("./context_images/test.jpg")

print(results)

base_model.label("./context_images", extension=".jpeg")

License

The code in this repository is licensed under an MIT license.

🏆 Contributing

We love your input! Please see the core Autodistill contributing guide to get started. Thank you 🙏 to all our contributors!

Metadata

Release files for autodistill-clip 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autodistill-clip 0.1.5
File Size Uploaded Provenance Actions
autodistill_clip-0.1.5.tar.gz 4.2 kB Without provenance Details for autodistill_clip-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for autodistill-clip 0.1.5
File Interpreter ABI Platform Actions
autodistill_clip-0.1.5-py3-none-any.whl Python 3 none any Details for autodistill_clip-0.1.5-py3-none-any.whl

Total release size: 8.6 kB

Release files / autodistill_clip-0.1.5.tar.gz

Download URL autodistill_clip-0.1.5.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e74d773822bdbb4c163f46e1c71d5bda7db1a5379dc5f66f4b72f09dc8769f00
BLAKE2b-256 checksum
How to use checksums
d4f26b5f38355f885e7ed12cb7a67c018b38bd33353b3abac28615fb1f6373d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / autodistill_clip-0.1.5-py3-none-any.whl

Download URL autodistill_clip-0.1.5-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45b2b566d0edbba1fabd1c2742dff867c7533103e2e913a3d26c4ecfc7acb5f5
BLAKE2b-256 checksum
How to use checksums
e8dfe1724244c736c207f90c092d10981538631bb82fcf94a1bfab8a0306ae29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for autodistill-clip 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page