in 04_detect_segment/utils_box.py [0:0]
def rois_in_tiles_relative_and_pad(tiles, rois, max_per_tile, assert_on_overflow=True):
rois, overflow = remove_non_intersecting_rois_and_pad(tiles, rois, max_per_tile) # [n_tiles, max_per_tile, 4]
rois = make_rois_relative_to_tiles(tiles, rois)
# replace empty ROIs by (0,0,0,0) for clarity
is_roi_empty = find_empty_rois(rois)
rois = zero_where(rois, is_roi_empty)
# Log error if padding overflow
if assert_on_overflow:
with tf.control_dependencies([tf.debugging.assert_non_positive(overflow,
message="ROI per tile overflow. Set MAX_TARGET_ROIS_PER_TILE to a larger value.")]):
rois = tf.identity(rois)
return rois