Batch Processing

This function block collects multiple input values into a single batch container to reduce memory usage during processing. Use it when you want to group items (images, data, or generic values) into a single stream that other blocks can consume as a batch.

πŸ“₯ Inputs

Input 1 First value to be included in the batch. Can be image data, numbers, text, lists, or other generic values.

Input 2 Second value to be included in the batch. Additional inputs can be connected depending on your workflow.

πŸ“€ Outputs

Batch A single batched list that contains the connected input values grouped for batch processing.

πŸ•ΉοΈ Controls

This function block has no interactive controls. It works by grouping whatever is connected to its input sockets.

🎯 Features

  • Groups multiple inputs into a single, memory-friendly batch object for downstream processing.

  • Accepts generic data types so it can batch images, numbers, text or lists.

  • Useful for lowering memory footprint when handling many items in a pipeline.

πŸ“ How to use

  1. Connect the items you want to group into Input 1 and Input 2 (or more inputs if available).

  2. The block will output a single Batch that contains those inputs as a list.

  3. Feed the Batch output into blocks that accept batch-style input or into blocks that can iterate over the batch.

βš™οΈ Running behavior

When the scenario runs, the function block collects values present at its input sockets and emits them bundled as a single Batch. If an input is missing or invalid, the batch will include a placeholder for that entry so downstream blocks can handle it consistently.

πŸ’‘ Tips and Tricks

  • Create grouped image sets from multiple sources by combining image inputs like Load Image, Camera USB, Camera IP (ONVIF), or Video into a single Batch for processing.

  • Use Batch Processing before heavy AI blocks such as Object Detection, Mask Detection, Super Resolution, or OCR to reduce peak memory usage when running many images.

  • After processing a batch, use Debatch to split the results back into individual items for drawing or saving.

  • Merge multiple batches with Batch Concatenation when you need to combine batches created in different parts of a workflow.

  • Use Get Batch Size and Get Element to inspect or access items inside the Batch for conditional logic or selective processing.

  • When saving results, connect the per-item outputs (after Debatch) to Image Logger, Image Write, or Record Video to store processed images efficiently.

πŸ› οΈ Troubleshooting

  • No data in Batch: Verify the upstream blocks are producing values on the inputs. If an input is intentionally empty, that empty slot will appear in the batch.

  • Unexpected item order: The batch preserves the order of inputs as connected. Reorder connections if a different sequence is required.

  • Downstream blocks not accepting the batch: Some blocks expect single items rather than batches. Use Debatch to convert a batch back to individual items before feeding those blocks.

Last updated

Was this helpful?