Filter images
Overview
Matches images by object-count, asset-tag, class, image-size, and object conditions, combined with And or Or, then adds the matched images — or everything but them — with their annotations to a destination dataset.
The badge shows how many new images were added and opens the result.
How it works
Checks every image of the source dataset against the conditions you set, combined with And or with Or.
FAQ
How are multiple conditions combined?
The Operator input decides. With And, the default, an image matches only when it satisfies every condition you set. With Or, one is enough. Conditions left empty do not take part, and a single condition means the same thing either way. Setting no condition at all is a validation error rather than a match-everything run.
A range counts as one condition whether you fill one side of it or both. The tag conditions also count as one: every listed tag must be present. The object conditions (area, box aspect, geometry, object tag) form a single condition as well — one object must satisfy all of them at once.
Which annotation is checked?
Object counts, annotation tags, classes, and object conditions come from the image’s annotation in the source dataset. Image tag conditions read the image itself.
An image without an annotation counts as having zero objects and no classes, and it never matches an annotation tag or object condition. With Matched images set to Remove, such images therefore stay in the result.
Where does the image size come from?
From the image’s annotation first, and from the image’s own metadata when the annotation does not record it. An image whose size is not known from either source never matches an image-size condition.
Every range works the same way: fill both sides to bound it from both ends, fill one side for “at least” or “at most”, and leave both empty to switch the condition off.
Why is the first run with object or image-size conditions slower?
These conditions need per-object statistics. The first run computes them for every annotation that does not have them yet, which means downloading those annotations. Later runs over the same annotations reuse the results.
What if I don't select a destination dataset?
The node writes into its own output dataset — created on the first run, a new empty version of it on a rerun.
What if no images are selected?
The run succeeds and the badge shows zero. A new destination stays empty, while an existing destination stays unchanged.
Why can the badge count be lower than the number of selected images?
Images already present in the destination dataset are skipped. The badge counts only newly added images.
Inputs
Dataset to filter. Key: SRC_DATASET.
Where the selected images go. Leave empty to use the node’s own output dataset. Key: DST_DATASET.
Remove keeps everything except the matches. Keep keeps only the matches. Key: MATCHED_IMAGES.
Options:
- Remove (
remove) - Keep (
keep)
And requires every condition below. Or requires just one of them. Key: CONDITIONS_OPERATOR.
Options:
- And (
and) - Or (
or)
Tags the image or its annotation carries. Write images:key or annotations:key, and add =value to require a value. Values come from SRC_DATASET. Key: HAS_TAGS.
Classes the image must contain at least one of. Values come from SRC_DATASET. Key: HAS_CLASSES.
Pixel width an image must fall within. Minimum: 1. Step: 1. Key: IMAGE_WIDTH_PX.
Pixel height an image must fall within. Minimum: 1. Step: 1. Key: IMAGE_HEIGHT_PX.
Number of objects an image must have, counted from its annotation. Minimum: 0. Step: 1. Key: OBJECTS_COUNT.
Share of the image one object covers, in percent. Minimum: 0. Maximum: 100. Step: 0.5. Key: OBJECT_AREA_PERCENT.
How stretched one object is: its long side over its short side. 1 is a square. Minimum: 1. Step: 0.1. Key: OBJECT_BOX_ASPECT.
Shape the object is drawn with. Key: OBJECT_GEOMETRY.
Options:
- Rectangle (
rectangle) - Polygon (
polygon) - Bitmap (
bitmap) - Alpha mask (
alpha_mask) - Point (
point) - Line (
line) - Graph (
graph)
Tag the object carries. Write key, or key=value to require a value. Key: OBJECT_TAG.
Outputs
ID of the destination dataset with selected images. Shown as an artifact. Key: DATASET.
Number of images added to the destination dataset. Shown on the node as a badge. Selecting the badge opens DATASET. Key: LAST_IMAGES_COUNT.
JSON config
Machine-readable node interface for automation and advanced usage.