Skip to main content

EfficientSAM + YOLO-World base model for use with Autodistill

Project description

Autodistill EfficientYOLOWorld Module

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

EfficientYOLOWorld is a combination of two models:

  1. YOLO-World, a zero-shot object detection model, and;
  2. EfficientSAM, an image segmentation model.

This model runs EfficientSAM on each bounding box region generated by YOLO-World. This allows you to retrieve both the bounding box and the segmentation mask for each object of interest in an image.

Read the full Autodistill documentation.

Read the EfficientYOLOWorld Autodistill documentation.

Installation

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

pip3 install autodistill-efficient-yolo-world

Quickstart

from autodistill_efficient_yolo_world import EfficientYOLOWorld
from autodistill.detection import CaptionOntology
import cv2
import supervision as sv

# define an ontology to map class names to our EfficientYOLOWorld 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 = EfficientYOLOWorld(ontology=CaptionOntology({"book": "book"}))

# predict on an image
result = base_model.predict("bookshelf.jpeg", confidence=0.1)

image = cv2.imread("bookshelf.jpeg")

mask_annotator = sv.MaskAnnotator()
annotated_frame = mask_annotator.annotate(
	scene=image.copy(),
	detections=result,
)

sv.plot_image(annotated_frame)

base_model.label("./context_images", extension=".jpeg")

License

EfficientSAM is licensed under an Apache 2.0 license.

YOLO-World is licensed under a GPL-3.0 license.

🏆 Contributing

We love your input! Please see the core Autodistill 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

Built Distribution

File details

Details for the file autodistill-efficient-yolo-world-0.1.1.tar.gz.

File metadata

File hashes

Hashes for autodistill-efficient-yolo-world-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a23f90388868e5d1f40482e85a64e5753d24e88f3e38c70231b9657e2eca0bca
MD5 c2b60140b7084c6ae6ca90b97662d47f
BLAKE2b-256 632f145af030407771d48be1bb862a9fc6efdba085376bee681dd74fbe85df4d

See more details on using hashes here.

File details

Details for the file autodistill_efficient_yolo_world-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for autodistill_efficient_yolo_world-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef631c6f1413c4c66d66ae7c94675d3613a63d777f7d849e0955b55fe45494b2
MD5 0bc0fa5485f6bd95c25bd2083f0d57af
BLAKE2b-256 6bdec28b11dead9f88ea3551ef11b477fd286f130a1654e4f2619e801777e5e3

See more details on using hashes here.

Supported by

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