Skip to content

Latest commit

 

History

History
64 lines (46 loc) · 2.14 KB

README.md

File metadata and controls

64 lines (46 loc) · 2.14 KB

Autodistill OmdetTurbo Module

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

OmdetTurbo, developed by Binjiang Institute of Zhejiang University, is a computer vision model for zero-shot detection in real time.

Read the full Autodistill documentation.

Read the Omdet-turbo Autodistill documentation.

Installation

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

pip3 install autodistill-omdet_turbo

Quickstart

from autodistill_omdet_turbo import OmdetTurbo
from autodistill.detection import CaptionOntology
from autodistill.utils import plot
import cv2

# define an ontology to map class names to our OmdetTurbo 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 = OmdetTurbo(
    ontology=CaptionOntology({"person": "person", "a forklift": "forklift"})
)

results = base_model.predict("iamge.png")

plot(
    image=cv2.imread("image.png"),
    classes=base_model.ontology.classes(),
    detections=results,
)
base_model.label("./context_images", extension=".jpeg")

License

This model is licensed under an Apache 2.0 (see original model implementation license, and the corresponding HuggingFace Transformers documentation).

🏆 Contributing

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