prune_outside_window(boxlist: NpBoxList, window: ndarray) Tuple[NpBoxList, ndarray][source]#

Prunes bounding boxes that fall outside a given window.

This function prunes bounding boxes that even partially fall outside the given window. See also ClipToWindow which only prunes bounding boxes that fall completely outside the window, and clips any bounding boxes that partially overflow.

  • boxlist (BoxList) – A BoxList holding M_in boxes.

  • window (np.ndaarray) – A numpy array of size 4, representing [ymin, xmin, ymax, xmax] of the window.


Pruned Boxlist of length <= M_in and an array of shape [M_out] indexing the valid bounding boxes in the input tensor.

Return type

Tuple[BoxList, np.ndarray]