Autodistill BioCLIP Module
This repository contains the code supporting the BioCLIP base model for use with Autodistill.
BioCLIP is a CLIP model trained on the TreeOfLife-10M dataset, created by the researchers who made BioCLIP. The dataset on which BioCLIP was trained included more than 450,000 classes.
You can use BioCLIP to auto-label natural organisms (i.e. animals, plants) in images for use in training a classification model. You can combine this model with a grounded detection model to identify the exact region in which a given class is present in an image. Learn more about combining models with Autodistill.
Read the full Autodistill documentation.
Read the BioCLIP Autodistill documentation.
Installation
To use BioCLIP with autodistill, you need to install the following dependency:
pip3 install autodistill-bioclip
Quickstart
from autodistill_bioclip import BioCLIP
# define an ontology to map class names to our BioCLIP 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
classes = ["arabica", "robusta"]
base_model = BioCLIP(
ontology=CaptionOntology(
{
item: item for item in classes
}
)
)
results = base_model.predict("../arabica.jpeg")
top = results.get_top_k(1)
top_class = classes[top[0][0]]
print(f"Predicted class: {top_class}")
License
This project is licensed under an MIT license.
The underlying BioCLIP model is also 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-bioclip 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| autodistill-bioclip-0.1.0.tar.gz | 4.2 kB | Without provenance | Details for autodistill-bioclip-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| autodistill_bioclip-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for autodistill_bioclip-0.1.0-py3-none-any.whl |
Total release size: 8.7 kB
Release files / autodistill-bioclip-0.1.0.tar.gz
| Download URL | autodistill-bioclip-0.1.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c87f28bd6a758be599dbb0108ed92ac84a3ee81cb95f23f69e9408d10a1135ac
|
|
BLAKE2b-256 checksum How to use checksums |
dda28cbb914dd506cec9ec4661dcd221950bdd51fdad5f890324c43273b9d614
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / autodistill_bioclip-0.1.0-py3-none-any.whl
| Download URL | autodistill_bioclip-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
96ffacde93916bd22f4fd09af97ba30c438b92281dca56be26f0e9739c0f8298
|
|
BLAKE2b-256 checksum How to use checksums |
cb9fd4c2306e93e5c8f4beda2c323f6530794caf48bdd5b5a14a7c333b3a3ac9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for autodistill-bioclip 0.1.0
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.