@@ -65,8 +65,13 @@ def execute_compose(
6565 Args:
6666 data: a tensor-like object to be transformed
6767 transforms: a sequence of transforms to be carried out
68- map_items: whether to apply transform to each item in the input `data` if `data` is a list or tuple.
69- defaults to `True`. If set to an integer, recursively map the items in `data` `map_items` times.
68+ map_items: controls whether to apply a transformation to each item in `data`. If `data` is a list or tuple,
69+ it can behave as follows:
70+ - Defaults to True, which is equivalent to `map_items=1`, meaning the transformation will be applied
71+ to the first level of items in `data`.
72+ - If an integer is provided, it specifies the maximum level of nesting to which the transformation
73+ should be recursively applied. This allows treating multi-sample transforms applied after another
74+ multi-sample transform while controlling how deep the mapping goes.
7075 unpack_items: whether to unpack input `data` with `*` as parameters for the callable function of transform.
7176 defaults to `False`.
7277 start: the index of the first transform to be executed. If not set, this defaults to 0
@@ -205,8 +210,13 @@ class Compose(Randomizable, InvertibleTransform, LazyTransform):
205210
206211 Args:
207212 transforms: sequence of callables.
208- map_items: whether to apply transform to each item in the input `data` if `data` is a list or tuple.
209- defaults to `True`. If set to an integer, recursively map the items in `data` `map_items` times.
213+ map_items: controls whether to apply a transformation to each item in `data`. If `data` is a list or tuple,
214+ it can behave as follows:
215+ - Defaults to True, which is equivalent to `map_items=1`, meaning the transformation will be applied
216+ to the first level of items in `data`.
217+ - If an integer is provided, it specifies the maximum level of nesting to which the transformation
218+ should be recursively applied. This allows treating multi-sample transforms applied after another
219+ multi-sample transform while controlling how deep the mapping goes.
210220 unpack_items: whether to unpack input `data` with `*` as parameters for the callable function of transform.
211221 defaults to `False`.
212222 log_stats: this optional parameter allows you to specify a logger by name for logging of pipeline execution.
@@ -391,8 +401,13 @@ class OneOf(Compose):
391401 transforms: sequence of callables.
392402 weights: probabilities corresponding to each callable in transforms.
393403 Probabilities are normalized to sum to one.
394- map_items: whether to apply transform to each item in the input `data` if `data` is a list or tuple.
395- defaults to `True`. If set to an integer, recursively map the items in `data` `map_items` times.
404+ map_items: controls whether to apply a transformation to each item in `data`. If `data` is a list or tuple,
405+ it can behave as follows:
406+ - Defaults to True, which is equivalent to `map_items=1`, meaning the transformation will be applied
407+ to the first level of items in `data`.
408+ - If an integer is provided, it specifies the maximum level of nesting to which the transformation
409+ should be recursively applied. This allows treating multi-sample transforms applied after another
410+ multi-sample transform while controlling how deep the mapping goes.
396411 unpack_items: whether to unpack input `data` with `*` as parameters for the callable function of transform.
397412 defaults to `False`.
398413 log_stats: this optional parameter allows you to specify a logger by name for logging of pipeline execution.
0 commit comments