code: def filter_bboxes(bboxes, rows, cols, min_area=0., min_visibility=0.):
      
      resulting_boxes = []
      for bbox in bboxes:
          transformed_box_area = calculate_bbox_area(bbox, rows, cols)
          bbox[:4] = np.clip(bbox[:4], 0, 1.)
          clipped_box_area = calculate_bbox_area(bbox, rows, cols)
          if not transformed_box_area or clipped_box_area / transformed_box_area <= min_visibility:
              continue
          else:
              bbox[:4] = np.clip(bbox[:4], 0, 1.)
          if calculate_bbox_area(bbox, rows, cols) <= min_area:
              continue
          resulting_boxes.append(bbox)
      return resulting_boxes
docs: 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.