Wrong rotation output of box annotations in exporting to YOLO format
The output of exporting rotated box from Label-Studio format json to YOLO format is wrong.
To Reproduce
Steps to reproduce the behavior:
Prepare an annotation with rect labels , at least one of the box annotations need to have 90 degree rotation.
Export the annotation to YOLO format using botton on web page.
Check the format annotation txt.
I found out this error when I try to reformate the YOLO labels and import them into Label-Studio to recheck labels.
Expected behavior
This is the original annotation.
I compared 2 annotations that have nearly 100% IoU in json format label and exported YOLO label, the data is calculated in Excel.
The final 6 columns shows the different. Only the YOLO output of rotate box is wrong.
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
Wrong rotation output of box annotations in exporting to YOLO format The output of exporting rotated box from Label-Studio format json to YOLO format is wrong.
To Reproduce Steps to reproduce the behavior:
Expected behavior This is the original annotation.
I compared 2 annotations that have nearly 100% IoU in json format label and exported YOLO label, the data is calculated in Excel. The final 6 columns shows the different. Only the YOLO output of rotate box is wrong. <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
| x_center | y_center | w_norm | h_norm | rotate angle | x1 | y1 | w | h | wpix | hpix | x1pix | y1pix | x2pix | y2pix | actual x1 | actual y1 | actual x2 | actual y2 | actual w | actual h -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- Label-Studio json label1 (X1 Y1 W H) | | | | | 90 | 43.11703267 | 84.45983 | 2.306614 | 2.541162 | 1280 | 720 | 551.898 | 608.1108 | 533.6017 | 637.6354 | 41.68763 | 84.45983 | 43.11703 | 88.56048 | 1.429404 | 4.100648 Label-Studio json label2 (X1 Y1 W H) | | | | | 0 | 41.68144192 | 84.43197 | 1.434949 | 4.081633 | 1280 | 720 | 533.5225 | 607.9102 | 551.8898 | 637.298 | 41.68144 | 84.43197 | 43.11639 | 88.51361 | 1.434949 | 4.081633 Label-Studio YOLO label1 (X_CENTER Y_CENTER W H) | 0.41843 | 0.856094 | 0.02548 | 0.023141 | 0 | 40.56904665 | 84.4523 | 2.547986 | 2.314134 | 1280 | 720 | 519.2838 | 608.0565 | 551.898 | 624.7183 | 40.56905 | 84.4523 | 43.11703 | 86.76643 | 2.547986 | 2.314134 Label-Studio YOLO label2 (X_CENTER Y_CENTER W H) | 0.423989 | 0.864728 | 0.014349 | 0.040816 | 0 | 41.68144192 | 84.43197 | 1.434949 | 4.081633 | 1280 | 720 | 533.5225 | 607.9102 | 551.8898 | 637.298 | 41.68144 | 84.43197 | 43.11639 | 88.51361 | 1.434949 | 4.081633 json Label1 transfromed to 0 degree (central rotation) | | | | | 0 | 41.68762902 | 84.45983 | 1.429404 | 4.100648 | 1280 | 720 | 533.6017 | 608.1108 | 551.898 | 637.6354 | 41.68763 | 84.45983 | 43.11703 | 88.56048 | 1.429404 | 4.100648