Back to Templates

Run OWLv2 Detector on Images

Label your images with OWLv2 from a few labeled examples or from class names, with no training.

, 2 nodes, 1 connection, 1 variable

Read-only preview

About this template

Label your images with OWLv2, an open-vocabulary detector, by showing it a few labeled examples or typing the class names. No training needed.

Main idea: OWLv2 can be told what to find in two ways. Visual examples: you box a few objects on a handful of images, and it finds objects that look like them. Class names: you type the name of each class. Examples work for things a name cannot describe, such as cell types or defects. Names need no labeled images at all.

Overview

  • Model: OWLv2 (Google's open-vocabulary detector), L/14 or B/16, or the original OWL-ViT. Ready-made, no training
  • Task: Object detection prelabeling
  • Input: Images to prelabel, plus either a few labeled images or a list of class names
  • Pipeline: images -> OWLv2 prompted by examples or names -> labeled copy of the images
  • Output: A new dataset with the same images and OWLv2's boxes, each with a class and a score

Setup

When you add the template, the setup wizard asks three questions:

Question What you do
1. Which images do you want to prelabel? Pick an image dataset from your workspace.
2. How will you tell OWLv2 what to find? Visual examples: turn on Reference images and pick a dataset with a few labeled images. Class names: choose Class names and add the classes. Both uses the names and the examples together.
3. Which checkpoint labels the images? Pick OWLv2 L/14 or B/16 from the model zoo, or one of the OWL-ViT checkpoints.

Press Start and the images are labeled.

To bring images in first, use Import images by drag & drop, Import from Dataset Ninja or Import from Supervisely.

How it works

Node What happens Docs
Images to prelabel The dataset you picked in the wizard. Dataset
Predict OWLv2 Labels every image from your examples or class names and writes the boxes into a new dataset. Predict OWLv2

Key concepts

Reference images. Every box on them is an example of its class. Label every object of a class on these images: the rest of the image is what each example is compared against, so an object left unlabeled counts against it. Ten images with a few boxes per class are usually enough. OWLv2 takes up to 8 examples per class, typical-sized ones first, spread across the images (Examples per class in the node's advanced settings).

Which prompt to use. Try examples first when you have a few labeled images. Class names work well for everyday objects and poorly for specialist ones: on blood smears, OWLv2 found almost nothing from the class names and most of the cells from ten labeled images.

Which checkpoint. OWLv2 finds noticeably more than OWL-ViT. L/14 finds the most. B/16 takes about a third of its GPU time and comes close with examples.

Thresholds. A box is kept when it scores at least 0.2 against a class name or 0.5 against an example (text_threshold, visual_threshold in the node's Config). Lower them when OWLv2 misses objects, and raise them when it boxes too much background.

Results

  • Prelabeled dataset. Each image with OWLv2's boxes, a class and a score on each. Use it as prelabels for labeling and review, or as training data after review.
  • Image count. The node reports how many images it annotated.

OWLv2 works best on compact, distinct objects. It struggles with thin, tiny or heavily overlapping ones.

Next steps