def get_poly_bounds(poly1):
    """ Find the bounds of the Polygon.

    Parameters
    -------
    poly1 : Polygon
        contour with shapely polygon format

    Returns
    -------
    min_h : int
        minimum y coordinate of polygon
    min_w : int
        minimum x coordinate of polygon
    max_h : int
        maximum y coordinate of polygon
    max_w : int
        maximum x coordinate of polygon

    """

    min_x, min_y, max_x, max_y = poly1.bounds
    min_h, min_w = min_y, min_x
    max_h, max_w = max_y, max_x

    return min_h, min_w, max_h, max_w