Get next batch
Overview
Walks through a dataset in batches. Each run sends the next images, with their annotations, and an image sent once is never sent again by the same node. Put it after a dataset that keeps growing to feed the next steps a fixed amount of new data per run.
LAST_RUN opens the latest batch. A hidden SENT_ASSETS output points to the history dataset that keeps later runs from sending those images again. The badge shows the size of the latest batch and how many images were sent across all runs, such as 20 passed (5 new).
How it works
FAQ
What happens when new images are added to the source?
Each run reads the source as it is at that moment. New images join the end of the queue and come out in the next batches, after the images that were already waiting.
What happens when every image has already been sent?
The node stops the flow, returns no LAST_RUN dataset, and the badge shows no new. When new images arrive in the source, the next run sends them.
What happens to the batch dataset on a rerun?
The node writes each batch into its own output dataset, named after the source, such as Next batch (Cats): created on the first run, a new empty version of it on every rerun, so LAST_RUN holds only the latest batch and the version history shows every earlier one.
How do I start again from the first image?
The history belongs to this node and has no reset. A newly added Get next batch node starts from the first image.
Can this node send videos?
No. This version sends image assets only.
Inputs
Dataset to walk through. It can keep growing, and each run reads its current contents. Key: SRC_DATASET.
Number of images each run sends on. The last batch can be smaller. Minimum: 1. Step: 1. Key: BATCH_SIZE.
Outputs
Dataset with the images of the latest batch, named after the source dataset. A rerun writes a new version of it, and a new source starts a new dataset. Shown as an artifact. Key: LAST_RUN.
Short badge with the number of images in the latest batch and the number sent across all runs. Shown on the node as a badge. Key: PROGRESS.
Number of images in the latest batch, as a plain number to compare in a Condition. 0 when no unsent image was left. Key: BATCH_COUNT.
ID of the dataset containing every image this node has sent across runs. Hidden from the flow editor. Key: SENT_ASSETS.
JSON config
Machine-readable node interface for automation and advanced usage.