def validate_boxes(boxes, width=0, height=0):
 x1 = boxes[:, 0]
 y1 = boxes[:, 1]
 x2 = boxes[:, 2]
 y2 = boxes[:, 3]
 assert (x1 >= 0).all()
 assert (y1 >= 0).all()
 assert (x2 >= x1).all()
 assert (y2 >= y1).all()
 assert (x2 < width).all()
 assert (y2 < height).all()

def validate_boxes ( boxes , width = 0 , height = 0 ) : x1 = boxes [ : , 0 ] y1 = boxes [ : , 1 ] x2 = boxes [ : , 2 ] y2 = boxes [ : , 3 ] assert ( x1 >= 0 ) . all ( ) assert ( y1 >= 0 ) . all ( ) assert ( x2 >= x1 ) . all ( ) assert ( y2 >= y1 ) . all ( ) assert ( x2 < width ) . all ( ) assert ( y2 < height ) . all ( )
check that a set of boxes are valid .