def calcuate_bboxes(im_shape, patch_size):
    """Calculate bound boxes based on image shape and size of the bounding box
    given by `patch_size`"""
    h, w = im_shape
    ph, pw = patch_size

    steps_h = chain(range(0, h - ph, ph), [h - ph])
    steps_w = chain(range(0, w - pw, pw), [w - pw])

    return product(steps_h, steps_w)
def calcuate_bboxes ( im_shape , patch_size ) : h , w = im_shape ph , pw = patch_size steps_h = chain ( range ( 0 , h - ph , ph ) , [ h - ph ] ) steps_w = chain ( range ( 0 , w - pw , pw ) , [ w - pw ] ) return product ( steps_h , steps_w )
Calculate bound boxes based on image shape and size of the bounding box
    given by `patch_size`