cvat-ai / cvat

Annotate better with CVAT, the industry-leading data engine for machine learning. Used and trusted by teams at any scale, for data of any scale.
https://cvat.ai
MIT License
12.64k stars 3.01k forks source link

3D cuboids on a 2D image wrong visualization #4986

Open yaeji98 opened 2 years ago

yaeji98 commented 2 years ago

My actions before raising this issue

I am going to import/export the cuboid data(8 point). Only specific cuboid data come out weird.

ex. "cuboid.data": [ [ [ -1920.0, -679.189697265625 ], [ -2774.52587890625, -974.7096557617188 ], [ -2779.470458984375, -502.447998046875 ], [ -1936.765625, 470.2716064453125 ] ], [ [ 2912.739990234375, 1092.7972412109375 ], [ 2058.214111328125, 797.2772827148438 ], [ 2053.26953125, 1269.5389404296875 ], [ 2895.974365234375, 2242.258544921875 ] ] ]

Expected Behaviour

image

Current Behaviour

image

Possible Solution

Steps to Reproduce (for bugs)

[cuboid data pasing code]

                            shape = task_data.LabeledShape(
                                type="cuboid",
                                points = [
                                    front_cuboid[0][0], front_cuboid[0][1],
                                    front_cuboid[3][0], front_cuboid[3][1],
                                    front_cuboid[1][0], front_cuboid[1][1],
                                    front_cuboid[2][0], front_cuboid[2][1],
                                    back_cuboid[1][0], back_cuboid[1][1],
                                    back_cuboid[2][0], back_cuboid[2][1],
                                    back_cuboid[0][0], back_cuboid[0][1],
                                    back_cuboid[3][0], back_cuboid[3][1],
                                ],
                                    etc.....
                            )

Context

Your Environment

bsekachev commented 2 years ago

Hello, @yaeji98

First of all, Y-axis is top-to-down for images, so, you need to inverse it on your plot.

Secondly, I am not sure you provide correct points:

[-1920.0,-679.189697265625,-2774.52587890625,-974.7096557617188,-2779.470458984375,-502.447998046875,
-1936.765625,470.2716064453125,2912.739990234375,1092.7972412109375,2058.214111328125,797.2772827148438,
2053.26953125,1269.5389404296875,2895.974365234375,2242.258544921875]

because for example P1.X must be equal P2.X, and the same for other points (X values) image

For this drawn cuboid I have following coordinates: [ 380.50081686520934, 155.21849954559912, 380.50081686520934, 542.0536203740248, 752.3369988002232, 155.11566239168678, 752.3369988002232, 542.0536203740248, 1039.3536248062246, 287.0329367643335, 1039.3536248062246, 373.313287804609, 956.4065652638674, 287.04805302533896, 956.4065652638674, 373.3232898282604 ]

Trying to insert you coordinates directly on UI I get the following picture: Screenshot from 2022-09-22 10-10-22

yaeji98 commented 2 years ago

Hello, @bsekachev Thank you for your answer!!!😊👍 I checked the point and realized it wasn't right. I think I found a cvat bug while I was checking.

[problem point] [3840.0,2400.0,3938.467529296875,2257.75244140625,3935.806396484375,2632.5142211914062,3835.3311767578125,3103.7994995117188,1256.9227294921875,896.2984008789062,1355.3902587890625,754.0508422851562,1352.7291259765625,1128.8126220703125,1252.25390625,1600.097900390625]

image image

I think the coordinates are right, but it's a problem when you express it in cvat. I think it's a bug caused by the large value. in cvat, I think the back side is the problem

Thank you!!😁

bsekachev commented 2 years ago

Let's keep the issue opened until somebody has time to check it.

UPD: reordered and adjusted points are [1355,754,1355,1128,1256,896,1256,1600,3938,2257,3938,2623, 3840, 2400, 3840,3103]