Open ferenc-hechler opened 2 years ago
Looks like the export is generated in another project: label-studio-converter
The corresponding lines should be here (not yet tested): https://github.com/heartexlabs/label-studio-converter/blob/598420012b5cb6e9cd5283e62887ff33af36d0bb/label_studio_converter/converter.py#L649
Should I create a new Issue in label-studio-converter?
Thank you very much for your issue. Yes, it would be great if you could create a PR!
I'm also having this same issue with rotated images and yolo export. Was there ever a fix or workaround?
Describe the bug When exporting rotate annotations in YOLO format, the annotation is calculated wrong. The reason is, that the rotation is done with the percentages of the image height and width. But if the image is not quadratic this deforms the annotation.
To Reproduce Steps to reproduce the behavior:
Expected behavior The second line (90 degree rotated) and the third line (not rotated) should be identical. So it should be 0 0.35 0.3 0.3 0.2 1 0.15 0.5 0.1 0.6 2 0.15 0.5 0.1 0.6
Screenshots Annotations in Label-Studio. One horizontal 300x100, one horizontal 300x100 rotated by 90 degree and one vertical 300x100. The vertical and rotated annotation overlap exactly
Visualized results of the YOLO lines:
Line1 for label 0 (horizotal): x=35% y=30%, width=30%, height=20%
Line2 for label 1 (horizontal-rot90): x=10% y=35%, width=20%, height=30%
Line 3 for label 2 (vertical): x=15% y=50%, width=10%, height=60%
Environment (please complete the following information):
Additional context To fix this problem, the coordinates have to be scaled to a common ratio before rotating. So that 10% in horizontal direction have the same length as 10% in vertical direction.