Use Florence 2 to auto-label data for use in training fine-tuned object detection models.
Project description
Autodistill Florence 2 Module
This repository contains the code supporting the CLIP base model for use with Autodistill.
Florence 2, introduced in the paper Florence-2: Advancing a Unified Representation for a Variety of Vision Tasks is a multimodal vision model.
You can use Florence 2 to generate object detection annotations for use in training smaller object detection models with Autodistill.
Read the full Autodistill documentation.
Read the Florence 2 Autodistill documentation.
Installation
To use Florence 2 with Autodistill, you need to install the following dependency:
pip3 install autodistill-florence-2
Quickstart
from autodistill_florence_2 import Florence2
# define an ontology to map class names to our Florence 2 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 = Florence2(
ontology=CaptionOntology(
{
"person": "person",
"a forklift": "forklift"
}
)
)
base_model.label("./context_images", extension=".jpeg")
License
This project is licensed under an MIT license. See the Florence 2 license for more information about the Florence 2 model license.
🏆 Contributing
We love your input! Please see the core Autodistill contributing guide to get started. Thank you 🙏 to all our contributors!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for autodistill_florence_2-0.1.0.tar.gz
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | f2bc5e0135cd06de4cd7d62f64a30beb01978ea65f99351cb17cefc90a731319 |
|
| MD5 | e83882917d8956b7828630fc7cb48f18 |
|
| BLAKE2b-256 | b08dabee892bbce6e13ae2b30498eb115accd6ce5b3e8ef68b7e8886ea338d8a |
Hashes for autodistill_florence_2-0.1.0-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | b3e9f7ebe455d0d2537bac24f4032ce895958d972abf1721c8ccb9fe45595a77 |
|
| MD5 | a25dd5b2f29bb1f6baa65130cafa5340 |
|
| BLAKE2b-256 | 0bd2009ae9406d8190a2491aa86fee5099f885eb8bdf302e60b961c9af06e868 |