image-crop-by-class — Conditional AI Model
Crop straight to what a detector found by naming its class — several boxes of the same class can be merged or resolved by position. Reads the detection text, so no coordinates are typed by hand. CPU, instant.
Details
- CategoryConditional
- Year-1
- License
Inputs & Outputs
- ImageInputimage
The input image
- TextInputstring
Line separated input string. A line contains a class and bounding box coordinate
- ImageOutputimage
Cropped image region by detected class
Parameters
- target_classesstringdefault
Target class names (comma-separated)
Class names to crop, comma-separated. Must match labels emitted by the upstream Object Detection node. Multiple classes are unioned in the same output crop. Leave empty to skip cropping.
- dilationintegerdefault 0range 0–100
Box enlargement, % of box size (0-100)
Enlarges the box by this percentage of its own width and height (half on each side) before cropping — useful to include surrounding context (e.g. hair around a detected face); 20 makes the box 20% wider and taller. 0 (default) crops exactly to the detected box. To paste the processed crop back with Conditional-Image-Paste-By-Class, use the same value there.
- duplication_handlingstringdefault Mergeoptions: Merge, Left Most, Top Most, Right Most, Bottom Most, +1 more
Multi-instance handling
How to resolve when the same class is detected multiple times. 'Merge' (default) unions all boxes into one crop. 'Left Most' / 'Top Most' / 'Right Most' / 'Bottom Most' / 'Center Most' pick a single instance by spatial position. Use a positional rule when you want exactly one instance.
Tags
Alternatives in Selection & Extraction
- Color Pick by Class
Extract a segmentation class by name.
- Color Pick by RGB Value
Extract segmentation regions by exact RGB color.
- Image Collect
Gather separately made images into one image list, in port order.
- Image Crop by Coord
Crop a region from explicit bounding-box coordinates.
- Image Crop Each by Class
Crop every detected object into its own image.
- Image Gate by Text
Pass or block an image based on text match.
- Image Selector
Pick first non-empty image from inputs (fallback).
- List Extract
Extract one image from an image list by index.