label-studio-ml-backend
label-studio-ml-backend copied to clipboard
The rectangles of predictions shown in web are wrong, but the predictions are correct for the input image
The text area recognized by the OCR ml backend written by myself is misplaced on the web page, but the recognition result of the text content is correct. I use def convert_to_ls in https://labelstud.io/guide/predictions.html#Units-of-image-annotations to convert the unit.
I had the same issue until I realized the coordinate system of my model was different. It seems that label-studio uses X and Y values as the position of the top-left corner of the bounding box.
So, let's say you want to place a bounding box occupying the entire image. Then the coordinates would be:
- x = 0
- y = 0
- width = 100
- height = 100
At least it worked when I converted it to work that way.
Thanks for your sharing.
However, I tried another way to achieve it that I figured out the transformation functions between the wrong rectangle data I got from def convert_to_ls and the right data corrected mannually. It may sound a little strange and troublesome, but it works well.