Search code examples
computer-visionobject-detectionyolotransformer-modelyolov5

How to get YoloS predicted bounding boxes ordered: from top part of image to lower


I am training an object detection to identify lines of handwritten texts (following this 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


Solution

  • You can order the predictions by their y1 value. The lower this value is the higher the line/bbox is in the text, making it possible to sort the predictions.