Crop objects
Overview
Crops object detection labels from images in a source dataset and saves each crop as a new image asset.
Crops are always written to the node’s own LAST_RUN dataset, a new version of it on every rerun.
When a destination dataset is provided, the same crops and crop annotations are also added there.
Use it when object detection annotations are available and the next step needs cropped object images.
Prerequisites
How it works
Crops every rectangle label, optionally limited to the selected classes and expanded by the configured padding.
FAQ
Which objects get cropped?
Rectangle (bounding-box) labels only. Other geometry types are skipped. Leave Classes empty to crop every class, or list specific class names.
How does padding work?
Enter padding as a comma-separated list of pixels or percentages, for example 10px,5%,10px,5%, ordered top, right, bottom, left. Leave it empty for no padding.
What does Class Tag do?
It sets each crop’s class from a label tag value instead of the object class name. For example, use a number tag to label number-plate crops by their value.
Where do the crops go?
Always to the node’s own LAST_RUN dataset, and also to the destination dataset when you connect one.
Why did the run fail with no crops?
The source dataset has no supported rectangle labels for the selected classes. Check the annotations and the Classes filter.
How do I find the source image of a crop?
Every crop asset carries its provenance in its metadata, so one asset read resolves it:
These live in metadata rather than tags: source_asset_id and source_bbox hold a distinct
value per crop, which would flood the tag filter dropdown. Metadata is not a search filter
surface, so it is read back per asset, not queried across a dataset.
Inputs
Source dataset the crops are cut from. Only rectangle annotations become crops. Key: SRC_DATASET.
Destination dataset the crops are added to. Leave empty to keep them only in the node’s own crops dataset. Key: DST_DATASET.
Class names to crop. Leave empty to crop all classes. Values come from SRC_DATASET. Key: CLASSES.
Extra space kept around each object, in pixels or as a percentage of its size, for example 10px or 10px,5%,10px,5%. Four values are read as top, right, bottom, left. Key: PADDINGS.
Name a tag on the object, and its value becomes the class of the crop - a “number” tag turns a number plate into a crop of that number. Leave empty to use the object’s own class. Key: CLASS_TAG.
Outputs
ID of the dataset with cropped assets. Key: DATASET.
Dataset with the crops of the latest run. A rerun writes a new version of it. Shown as an artifact. Key: LAST_RUN.
JSON config
Machine-readable node interface for automation and advanced usage.