https://github.com/autodistill/autodistill-florence-2

Use Florence 2 to auto-label data for use in training fine-tuned object detection models.

https://github.com/autodistill/autodistill-florence-2

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.6%) to scientific vocabulary

Keywords

autodistill florence-2 object-detection zero-shot-object-detection
Last synced: 5 months ago · JSON representation

Repository

Use Florence 2 to auto-label data for use in training fine-tuned object detection models.

Basic Info
Statistics
  • Stars: 67
  • Watchers: 5
  • Forks: 13
  • Open Issues: 6
  • Releases: 0
Topics
autodistill florence-2 object-detection zero-shot-object-detection
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme

README.md

Autodistill Florence 2 Module

This repository contains the code supporting the Florence 2 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:

bash pip3 install autodistill-florence-2

Quickstart (Inference from Base Weights)

```python from autodistillflorence2 import Florence2 from autodistill.detection import DetectionOntology from PIL import Image import supervision as sv

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" } ) )

image = Image.open("image.jpeg") result = base_model.predict('image.jpeg')

boundingboxannotator = sv.BoundingBoxAnnotator() annotatedframe = boundingboxannotator.annotate( scene=image.copy(), detections=detections ) sv.plotimage(image=annotated_frame, size=(16, 16))

label a dataset

basemodel.label("./contextimages", extension=".jpeg") ```

Quickstart (Fine-Tune)

```python from autodistillflorence2 import Florence2Trainer

model = Florence2Trainer("dataset") model.train(dataset.location, epochs=10) ```

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!

Owner

  • Name: Autodistill
  • Login: autodistill
  • Kind: organization
  • Email: autodistill@roboflow.com

Use bigger slower models to train smaller faster ones

GitHub Events

Total
  • Watch event: 4
  • Issue comment event: 3
  • Pull request event: 1
  • Fork event: 8
Last Year
  • Watch event: 4
  • Issue comment event: 3
  • Pull request event: 1
  • Fork event: 8

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 4
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 4
  • Total pull request authors: 1
  • Average comments per issue: 0.5
  • Average comments per pull request: 1.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • git-gfischer (1)
  • annabasiljose1 (1)
  • Samuel5106 (1)
  • danigarciaoca (1)
Pull Request Authors
  • Moayad-SR (2)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 947 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
pypi.org: autodistill-florence-2

Use Florence 2 to auto-label data for use in training fine-tuned object detection models.

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 947 Last month
Rankings
Dependent packages count: 10.8%
Average: 35.7%
Dependent repos count: 60.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • einops *
  • flash_attn *
  • numpy *
  • roboflow *
  • supervision *
  • timm *
  • transformers *