(boxes, im_width)
return boxes_flipped
Flip boxes horizontally.
Flip boxes horizontally.
Flip boxes horizontally .
def flip_boxes(boxes, im_width):
    """Flip boxes horizontally."""
    boxes_flipped = boxes.copy()
    boxes_flipped[:, 0::4] = im_width - boxes[:, 2::4] - 1
    boxes_flipped[:, 2::4] = im_width - boxes[:, 0::4] - 1
    return boxes_flipped
def flip_boxes ( boxes , im_width ) : boxes_flipped = boxes . copy ( ) boxes_flipped [ : , 0 : : 4 ] = im_width - boxes [ : , 2 : : 4 ] - 1 boxes_flipped [ : , 2 : : 4 ] = im_width - boxes [ : , 0 : : 4 ] - 1 return boxes_flipped