YoloS object detection in chronological order

Hi All,

I am training an object detection to identify lines of handwritten texts (following this notebook notebook, then I can crop each line detected for further processing. However, the bounding boxes are not in order as each lines appear in the original input image. Can someone help or point me to a useful resource?

Thanks