Example #1
0
def equalize_only_boxes(image, boxes, prob):
    """Apply equalize to each box in the image with probability prob."""
    func_changes_box = False
    prob = scale_box_only_op_probability(prob)

    return apply_multi_box_augmentation_wrapper(image, boxes, prob, equalize,
                                                func_changes_box)
def translate_y_only_boxes(image, boxes, prob, pixels, replace):
    """Apply translate_y to each box in image with probability prob."""
    func_changes_box = False
    prob = scale_box_only_op_probability(prob)

    return apply_multi_box_augmentation_wrapper(
        image, boxes, prob, translate_y, func_changes_box, pixels, replace)
Example #3
0
def cutout_only_boxes(image, boxes, prob, pad_size, replace):
    """Apply cutout to each box in the image with probability prob."""
    func_changes_box = False
    prob = scale_box_only_op_probability(prob)

    return apply_multi_box_augmentation_wrapper(image, boxes, prob, cutout,
                                                func_changes_box, pad_size,
                                                replace)
Example #4
0
def rotate_only_boxes(image, boxes, prob, angle, replace):
    """Apply rotate to each box in the image with probability prob."""
    func_changes_box = False
    prob = scale_box_only_op_probability(prob)

    return apply_multi_box_augmentation_wrapper(image, boxes, prob, rotate,
                                                func_changes_box, angle,
                                                replace)
Example #5
0
def shear_y_only_boxes(image, boxes, prob, level, replace):
    """Apply shear_y to each box in the image with probability prob."""
    func_changes_box = False
    prob = scale_box_only_op_probability(prob)

    return apply_multi_box_augmentation_wrapper(image, boxes, prob, shear_y,
                                                func_changes_box, level,
                                                replace)