def _filter_bb(self):
        """filters bounding boxes based on size and aspect ratio
        """
        if self.filter_bb:
            self.n_prefilter = len(self.boxes_xyxy)
            self.inds = filter_boxes(self.boxes_xyxy, min_area = self.min_area)
            self.boxes_xyxy = [bb for ind,bb in enumerate(self.boxes_xyxy) if ind in self.inds]
            if len(self.scores) == self.n_prefilter:
                self.scores = [bb for ind,bb in enumerate(self.scores) if ind in self.inds]
            self.n_postfilter = len(self.boxes_xyxy)
            logger.debug(f"filtered {self.n_prefilter} boxes to {self.n_postfilter}")
filters bounding boxes based on size and aspect ratio
        
src/marqo/s2_inference/processing/image.py