Add Tag to List

Description

This operator assigns a unique numeric tag to each element in the input list by generating an incremental index sequence starting from 0, and binding these indices as metadata to the corresponding elements in the list (if two lists are input, two elements at the same index will be given the same tag).

Overview

Adds index-based metadata tags to list elements.

Scenarios

Data association and synchronization: When you have two sets of data in one-to-one correspondence (e.g., a set of images and a set of corresponding detection results), filtering or other operations may change their order or count. You can use this operator to tag the data first, then use "extract by tag" type operators later to restore the correspondence.

Inputs and Outputs

Inputs

Input List 1: Primary list. The operator assigns incremental tags to each element in this list.

Input List 2: Optional aligned list. If provided, it shares the same tag set with Input List 1 by index.

Outputs

Output List 1: List 1 with tag metadata added.

Output List 2: List 2 with tag metadata added; if no second list is provided, this output is empty.