def validate_boxes(boxes, width=0, height=0):
    """Check that a set of boxes are valid."""
    assert boxes.shape[1] == 4, 'Func doesnot support tubes yet'
    x1 = boxes[:, 0]
    y1 = boxes[:, 1]
    x2 = boxes[:, 2]
    y2 = boxes[:, 3]
    return (
        (x1 >= 0).all() and
        (y1 >= 0).all() and
        (x2 >= x1).all() and
        (y2 >= y1).all() and
        (x2 < width).all() and
        (y2 < height).all())