Skip to main content

Automatically distill large foundational models into smaller, in-domain models for deployment

Project description

👋 hello

Automatically distill large, foundational models into smaller, realtime models via unsupervised and semi-supervised methods. Go from images to inference on a custom model with no labeling in between. Autodistill transfers knowledge from general models to domain-specific models that can run on the edge.

autodistill contains code to:

  • load base models (like CLIP)
  • load target models (like YOLO)
  • automatically create labeled datasets from raw image data
  • (optional) add a human in the loop for dataset review & curation
  • train target models
  • (optional) deploy trained models

💻 install

Pip install the supervision package in a 3.10>=Python>=3.7 environment.

pip install autodistill
Install from source
</code></pre>
</details>
<h2>🚀 examples</h2>
<pre lang="python"><code>from autodistill.base_models.instance_segmentation import GroundedSAM
from autodistill.base_models import classDescriptionOntology
from autodistill.target_models.instance_segmentation import YOLOv8,

# load ontology from json file
ontology from = classDescriptionOntology("path/to/ontology.json")

# load base model
base_model = GroundedSAM(ontology=ontology)
base_model.view_prediction(img_path="path/to/example.jpg") 

# create context
context_path = base_model.label(context="path/to/images/directory", upload_dataset_to_roboflow=False)

# destill target model
target_model = YOLOv8(size="n", hyper_params)
distilled_model = target_model.train(labeled_context=context_path, deploy_model_to_roboflow=False)
distilled_model.view_pred(img_path="path/to/example.jpg")
  • base_models are models that have been pre-trained to have a wide breadth of knowledge.

  • Base models have ontologies which are the prompts we can use to draw predictions from them. Deciding the proper ontology (and installing your CUDA drivers) is most of the work you will have to do to train distilled models with autodistill.

  • To distill a model, you will need to bring example data of the context you want to your model to operate in.

  • target_models are the smaller in-domain model to distill the larger base model into. These are a set of models that are known to perform well under supervised settings.

📍 roadmap

🚧 - work in progress

object detection

base / target YOLOv5 YOLOv7 YOLOv8 RT-DETR
Grounded DINO
Grounded SAM 🚧
DETIC
OWL-ViT

instance segmentation

base / target YOLOv5 YOLOv7 YOLOv8 RT-DETR
Grounded SAM 🚧

classification

base / target YOLOv8 YOLOv5
CLIP

🏆 contribution

We love your input! Please see our 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-0.0.6.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

autodistill-0.0.6-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file autodistill-0.0.6.tar.gz.

File metadata

  • Download URL: autodistill-0.0.6.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for autodistill-0.0.6.tar.gz
Algorithm Hash digest
SHA256 44417d074f72695aa889838c52a28249ad500d3a14edc6eb2c3eb698a538b58d
MD5 74c64370cbd48bcddc2fff4ddc75e3d1
BLAKE2b-256 824ca2a00c0377595c3d85a37f18c440f3dc74cf4d6b8859216e9d37abc9830e

See more details on using hashes here.

File details

Details for the file autodistill-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: autodistill-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for autodistill-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f74e7252abe4cbe803cd8d4471bd6c03debb5af08a57646fd6d633ba9b3fa9bc
MD5 f5dd44fde3f2d055f450895d4ff871cd
BLAKE2b-256 bc67b93b2c39f13dc2639535e5fadb219b3612159d2b08b35f1d47a36d184619

See more details on using hashes here.

Supported by

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