augmentables[i].shape[2]
if len(augmentables[i].shape) >= 3
else 1)
alpha = np.average(alphas[i, 0:nb_channels_i])
else:
alpha = alphas[i, 0]
assert 0 <= alpha <= 1.0, (
"Expected "alpha" to be in the interval [0.0, 1.0]. "
After Change
alphas_i = alphas[i, 0:nb_channels_i]
// the condition is required here if all images have a channel
// axis of size 0
alpha = np.average(alphas_i) if alphas_i.size > 0 else 1.0
else:
// the condition is required here if all images have a channel
// axis of size 0
alpha = alphas[i, 0] if alphas.size > 0 else 1.0