Yolo-World module for use with Autodistill
Project description
Autodistill: YOLO-World Base Model
This repository contains the code implementing YOLO-World as a Base Model for use with autodistill
.
YOLO-World combines YOLO-World brings YOLO like efficiency for training and inferring open-vocabulary models
Read the full Autodistill documentation.
Installation
To use the YOLO-World, simply install it along with a Target Model supporting the detection
task:
pip3 install autodistill-yolo-world
You can find a full list of detection
Target Models on the main autodistill repo.
Quickstart
from autodistill_yolo_world import YoloWorld
from autodistill.detection import CaptionOntology
from autodistill.utils import plot
import cv2
# define an ontology to map class names to our GroundedSAM 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 = YoloWorld(
ontology=CaptionOntology(
{
"person": "person",
"car": "car",
}
),
model_type = "yolov8s-world.pt"
)
# run inference on a single image
results = base_model.predict("assets/test.jpg")
plot(
image=cv2.imread("assets/test.jpg"),
classes=base_model.ontology.classes(),
detections=results
)
# label all images in a folder called `context_images`
base_model.label("./context_images", extension=".jpeg")
License
The code in this repository is licensed under an Apache 2.0 license.
🏆 Thanks
Thanks to autodistill and ultralytics
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
Close
Hashes for autodistill_yolo_world-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88cec038f09aeb2cf12d143585ec53ce8292dd5defd22740158041efb79b7568 |
|
MD5 | 163c7b02c1e7161e2881713e057d2adb |
|
BLAKE2b-256 | 628e6e48d1fb2dbb02793b10c65302bdcb190ae92c41ff3c21c6a53ddc4a8a4e |
Close
Hashes for autodistill_yolo_world-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 943a84cb75967a5769b59bf6d1f324482950e2e4a1632c2b862735a668c15d3a |
|
MD5 | b9c15e0612019ed8e66d0704af0dc9a2 |
|
BLAKE2b-256 | 2aa46f0fec11ad98beb2248b7a5f68ffdeee594ff19cfd283ac1f6255edf5e03 |