HumanSignal / label-studio-converter

Tools for converting Label Studio annotations into common dataset formats
https://labelstud.io/
255 stars 132 forks source link

What is the correct way to convert bbox from label studio to LayoutLMv3Processor bbox format? #232

Open aimlnerd opened 1 year ago

aimlnerd commented 1 year ago

Hi Used label studio for bbox annotation for LilT model. It uses LayoutLMv3Processor below https://huggingface.co/docs/transformers/model_doc/layoutlmv3#transformers.LayoutLMv3Model.forward.bbox

According to this documentation it says Each bounding box should be a normalized version in (x0, y0, x1, y1) format, where (x0, y0) corresponds to the position of the upper left corner in the bounding box, and (x1, y1) represents the position of the lower right corner. How to convert labelbox bbox to LayoutLMv3Processor bbox format?