def shear_with_bboxes(image, bboxes, level, replace, shear_horizontal):
    'Applies Shear Transformation to the image and shifts the 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 with values\n      between [0, 1].\n    level: Float. How much to shear the image. This value will be between\n      -0.3 to 0.3.\n    replace: A one or three value 1D tensor to fill empty pixels.\n    shear_horizontal: Boolean. If true then shear in X dimension else shear in\n      the Y dimension.\n\n  Returns:\n    A tuple containing a 3D uint8 Tensor that will be the result of shearing\n    image by level. The second element of the tuple is bboxes, where now\n    the coordinates will be shifted to reflect the sheared image.\n  '
    if shear_horizontal:
        image = shear_x(image, level, replace)
    else:
        image = shear_y(image, level, replace)
    image_height = tf.shape(image)[0]
    image_width = tf.shape(image)[1]
    wrapped_shear_bbox = (lambda bbox: _shear_bbox(bbox, image_height, image_width, level, shear_horizontal))
    bboxes = tf.map_fn(wrapped_shear_bbox, bboxes)
    return (image, bboxes)
Applies Shear Transformation to the image and shifts the 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 with values
    between [0, 1].
  level: Float. How much to shear the image. This value will be between
    -0.3 to 0.3.
  replace: A one or three value 1D tensor to fill empty pixels.
  shear_horizontal: Boolean. If true then shear in X dimension else shear in
    the Y dimension.

Returns:
  A tuple containing a 3D uint8 Tensor that will be the result of shearing
  image by level. The second element of the tuple is bboxes, where now
  the coordinates will be shifted to reflect the sheared image.
def shear_with_bboxes(image, bboxes, level, replace, shear_horizontal):
    'Applies Shear Transformation to the image and shifts the 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 with values\n      between [0, 1].\n    level: Float. How much to shear the image. This value will be between\n      -0.3 to 0.3.\n    replace: A one or three value 1D tensor to fill empty pixels.\n    shear_horizontal: Boolean. If true then shear in X dimension else shear in\n      the Y dimension.\n\n  Returns:\n    A tuple containing a 3D uint8 Tensor that will be the result of shearing\n    image by level. The second element of the tuple is bboxes, where now\n    the coordinates will be shifted to reflect the sheared image.\n  '
    if shear_horizontal:
        image = shear_x(image, level, replace)
    else:
        image = shear_y(image, level, replace)
    image_height = tf.shape(image)[0]
    image_width = tf.shape(image)[1]
    wrapped_shear_bbox = (lambda bbox: _shear_bbox(bbox, image_height, image_width, level, shear_horizontal))
    bboxes = tf.map_fn(wrapped_shear_bbox, bboxes)
    return (image, bboxes)