Skip to main content

ALBEF module for use with Autodistill

Project description

Autodistill ALBEF Module

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

ALBEF, developed by Salesforce, is a computer vision model that supports a range of tasks, including image-text pre-training, image-text retrieval, visual question anserting, and zero-shot classification. You can classify images using ALBEF with Autodistill.

Read the full Autodistill documentation.

Read the ALBEF Autodistill documentation.

Installation

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

pip3 install autodistill-albef

Quickstart

from autodistill_albef import ALBEF

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

License

This project is licensed under a 3-Clause BSD license.

🏆 Contributing

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autodistill-albef-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

autodistill_albef-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file autodistill-albef-0.1.0.tar.gz.

File metadata

  • Download URL: autodistill-albef-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for autodistill-albef-0.1.0.tar.gz
Algorithm Hash digest
SHA256 acc56bc7c75348a378124114516aeb9ff03beb046cce2fe6ffa37b3ca1119a72
MD5 c62db3a8b510e18520e40f41e5e036b7
BLAKE2b-256 a6840f8993feec91b3a121a067ee9ac8c0e9fa76f749a10f79a8fd33719d004c

See more details on using hashes here.

File details

Details for the file autodistill_albef-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for autodistill_albef-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60939821499c4619a24656f773daedbd2febf98f004f2f5e7abe3f0b7bd4a915
MD5 24cc3acb8ddf85b4d3458b644edafb31
BLAKE2b-256 e72752e75300fbc51b727230bfb5804d4c5b24e79401522b99c8fb2602b48c98

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page