def _apply_multi_bbox_augmentation(image, bboxes, prob, aug_func, func_changes_bbox, *args):
    'Applies aug_func to the image for each bbox in bboxes.\n\n  Args:\n    image: 3D uint8 Tensor.\n    bboxes: 2D Tensor that is a list of the bboxes in the image. Each bbox\n      has 4 elements (min_y, min_x, max_y, max_x) of type float.\n    prob: Float that is the probability of applying aug_func to a specific\n      bounding box within the image.\n    aug_func: Augmentation function that will be applied to the\n      subsections of image indicated by the bbox values in bboxes.\n    func_changes_bbox: Boolean. Does augmentation_func return bbox in addition\n      to image.\n    *args: Additional parameters that will be passed into augmentation_func\n      when it is called.\n\n  Returns:\n    A modified version of image, where each bbox location in the image will\n    have augmentation_func applied to it if it is chosen to be called with\n    probability prob independently across all bboxes. Also the final\n    bboxes are returned that will be unchanged if func_changes_bbox is set to\n    false and if true, the new altered ones will be returned.\n  '
    new_bboxes = tf.constant(_INVALID_BOX)
    bboxes = tf.cond(tf.equal(tf.shape(bboxes)[0], 0), (lambda : tf.constant(_INVALID_BOX)), (lambda : bboxes))
    bboxes = tf.ensure_shape(bboxes, (None, 4))
    wrapped_aug_func = (lambda _image, bbox, _new_bboxes: _apply_bbox_augmentation_wrapper(_image, bbox, _new_bboxes, prob, aug_func, func_changes_bbox, *args))
    num_bboxes = tf.shape(bboxes)[0]
    idx = tf.constant(0)
    cond = (lambda _idx, _images_and_bboxes: tf.less(_idx, num_bboxes))
    if (not func_changes_bbox):
        loop_bboxes = tf.random.shuffle(bboxes)
    else:
        loop_bboxes = bboxes
    body = (lambda _idx, _images_and_bboxes: [(_idx + 1), wrapped_aug_func(_images_and_bboxes[0], loop_bboxes[_idx], _images_and_bboxes[1])])
    (_, (image, new_bboxes)) = tf.while_loop(cond, body, [idx, (image, new_bboxes)], shape_invariants=[idx.get_shape(), (image.get_shape(), tf.TensorShape([None, 4]))])
    if func_changes_bbox:
        final_bboxes = new_bboxes
    else:
        final_bboxes = bboxes
    return (image, final_bboxes)
Applies aug_func to the image for each bbox in bboxes.

Args:
  image: 3D uint8 Tensor.
  bboxes: 2D Tensor that is a list of the bboxes in the image. Each bbox
    has 4 elements (min_y, min_x, max_y, max_x) of type float.
  prob: Float that is the probability of applying aug_func to a specific
    bounding box within the image.
  aug_func: Augmentation function that will be applied to the
    subsections of image indicated by the bbox values in bboxes.
  func_changes_bbox: Boolean. Does augmentation_func return bbox in addition
    to image.
  *args: Additional parameters that will be passed into augmentation_func
    when it is called.

Returns:
  A modified version of image, where each bbox location in the image will
  have augmentation_func applied to it if it is chosen to be called with
  probability prob independently across all bboxes. Also the final
  bboxes are returned that will be unchanged if func_changes_bbox is set to
  false and if true, the new altered ones will be returned.
def _apply_multi_bbox_augmentation(image, bboxes, prob, aug_func, func_changes_bbox, *args):
    'Applies aug_func to the image for each bbox in bboxes.\n\n  Args:\n    image: 3D uint8 Tensor.\n    bboxes: 2D Tensor that is a list of the bboxes in the image. Each bbox\n      has 4 elements (min_y, min_x, max_y, max_x) of type float.\n    prob: Float that is the probability of applying aug_func to a specific\n      bounding box within the image.\n    aug_func: Augmentation function that will be applied to the\n      subsections of image indicated by the bbox values in bboxes.\n    func_changes_bbox: Boolean. Does augmentation_func return bbox in addition\n      to image.\n    *args: Additional parameters that will be passed into augmentation_func\n      when it is called.\n\n  Returns:\n    A modified version of image, where each bbox location in the image will\n    have augmentation_func applied to it if it is chosen to be called with\n    probability prob independently across all bboxes. Also the final\n    bboxes are returned that will be unchanged if func_changes_bbox is set to\n    false and if true, the new altered ones will be returned.\n  '
    new_bboxes = tf.constant(_INVALID_BOX)
    bboxes = tf.cond(tf.equal(tf.shape(bboxes)[0], 0), (lambda : tf.constant(_INVALID_BOX)), (lambda : bboxes))
    bboxes = tf.ensure_shape(bboxes, (None, 4))
    wrapped_aug_func = (lambda _image, bbox, _new_bboxes: _apply_bbox_augmentation_wrapper(_image, bbox, _new_bboxes, prob, aug_func, func_changes_bbox, *args))
    num_bboxes = tf.shape(bboxes)[0]
    idx = tf.constant(0)
    cond = (lambda _idx, _images_and_bboxes: tf.less(_idx, num_bboxes))
    if (not func_changes_bbox):
        loop_bboxes = tf.random.shuffle(bboxes)
    else:
        loop_bboxes = bboxes
    body = (lambda _idx, _images_and_bboxes: [(_idx + 1), wrapped_aug_func(_images_and_bboxes[0], loop_bboxes[_idx], _images_and_bboxes[1])])
    (_, (image, new_bboxes)) = tf.while_loop(cond, body, [idx, (image, new_bboxes)], shape_invariants=[idx.get_shape(), (image.get_shape(), tf.TensorShape([None, 4]))])
    if func_changes_bbox:
        final_bboxes = new_bboxes
    else:
        final_bboxes = bboxes
    return (image, final_bboxes)