def channel_shift_multi(x, intensity, is_random=False, channel_index=<NUM_LIT:2>):
if is_random:<EOL><INDENT>factor = np.random.uniform(-intensity, intensity)<EOL><DEDENT>else:<EOL><INDENT>factor = intensity<EOL><DEDENT>results = []<EOL>for data in x:<EOL><INDENT>data = np.rollaxis(data, channel_index, <NUM_LIT:0>)<EOL>min_x, max_x = np.min(data), np.max(data)<EOL>channel_images = [np.clip(x_channel + factor, min_x, max_x) for x_channel in x]<EOL>data = np.stack(channel_images, axis=<NUM_LIT:0>)<EOL>data = np.rollaxis(x, <NUM_LIT:0>, channel_index + <NUM_LIT:1>)<EOL>results.append(data)<EOL><DEDENT>return np.asarray(results)<EOL>
Shift the channels of images with the same arguments, randomly or non-randomly, see `numpy.rollaxis <https://docs.scipy.org/doc/numpy/reference/generated/numpy.rollaxis.html>`__.
    Usually be used for image segmentation which x=[X, Y], X and Y should be matched.

    Parameters
    -----------
    x : list of numpy.array
        List of images with dimension of [n_images, row, col, channel] (default).
    others : args
        See ``tl.prepro.channel_shift``.

    Returns
    -------
    numpy.array
        A list of processed images.