Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image-driven object detection using OWLv2 #78

Merged
merged 4 commits into from
Feb 4, 2025

Conversation

sokovninn
Copy link
Member

Image-Driven Object Detection with OWLv2

This PR adds support for using images as visual prompts in OWLv2Annotator for object detection.

Example Usage:

annotator = OWLv2Annotator(device="cpu", size="base")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
im = Image.open(requests.get(url, stream=True).raw)

query_url = "http://images.cocodataset.org/val2017/000000058111.jpg"
query_image = Image.open(requests.get(query_url, stream=True).raw)

final_boxes, final_scores, final_labels = annotator.annotate_batch(
    [im], [query_image], conf_threshold=0.9
)

One query image is expected per target image to be queried. The number of query images must be either 1 (the same query image for all target images will be used) or the same as the number of target images.

In the future, integration into the main pipeline is possible.

test_image_guided

Copy link

github-actions bot commented Jan 31, 2025

Test Results

  6 files    6 suites   2h 7m 5s ⏱️
 75 tests  57 ✅  18 💤 0 ❌
450 runs  338 ✅ 112 💤 0 ❌

Results for commit 736cfcb.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@HonzaCuhel HonzaCuhel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but we need to find the cause of the failed Ubuntu unittests.

Copy link

github-actions bot commented Feb 4, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1823 1125 62% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
datadreamer/dataset_annotation/owlv2_annotator.py 65% 🟢
TOTAL 65% 🟢

updated for commit: 736cfcb by action🐍

@sokovninn sokovninn merged commit b24f6f3 into dev Feb 4, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants