Try Pro FREE for 2 weeksGet Started

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

  • crop
  • extraction
  • detection-post-process
  • class-based

Alternatives in Selection & Extraction

All AI models