def filter_bboxes(bboxes, rows, cols, min_area=<NUM_LIT:0.>, min_visibility=<NUM_LIT:0.>):
resulting_boxes = []<EOL>for bbox in bboxes:<EOL><INDENT>transformed_box_area = calculate_bbox_area(bbox, rows, cols)<EOL>bbox[:<NUM_LIT:4>] = np.clip(bbox[:<NUM_LIT:4>], <NUM_LIT:0>, <NUM_LIT:1.>)<EOL>clipped_box_area = calculate_bbox_area(bbox, rows, cols)<EOL>if not transformed_box_area or clipped_box_area / transformed_box_area <= min_visibility:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>bbox[:<NUM_LIT:4>] = np.clip(bbox[:<NUM_LIT:4>], <NUM_LIT:0>, <NUM_LIT:1.>)<EOL><DEDENT>if calculate_bbox_area(bbox, rows, cols) <= min_area:<EOL><INDENT>continue<EOL><DEDENT>resulting_boxes.append(bbox)<EOL><DEDENT>return resulting_boxes<EOL>
Remove bounding boxes that either lie outside of the visible area by more then min_visibility
    or whose area in pixels is under the threshold set by `min_area`. Also it crops boxes to final image size.

    Args:
        bboxes (list): List of bounding box with coordinates in the format used by albumentations
        rows (int): Image rows.
        cols (int): Image cols.
        min_area (float): minimum area of a bounding box. All bounding boxes whose visible area in pixels
            is less than this value will be removed. Default: 0.0.
        min_visibility (float): minimum fraction of area for a bounding box to remain this box in list. Default: 0.0.