cvat
cvat copied to clipboard
Keeping annotations order
My actions before raising this issue
- [x] Read/searched the docs
- [x] Searched past issues
Expected Behaviour
I expect the order of the annotations objects to stay the same after saving and doing a page refresh.
Current Behaviour
The order doesn't stay the same after a page refresh (the IDs of the annotations are overwritten).
Possible Solution
Add an option to keep annotations order or make this a default behavior.
Steps to Reproduce (for bugs)
- Create a project and add a task
- Create 4-5 annotations on the first image (see the right column and remember the annotations order)
- Save and refresh
- The order of annotation IDs has changed (see the right column again)
Context
When working on a multi-column document layout detection or a similar project, the order of the annotations is mandatory to keep the flow of the content chaining.
Your Environment
- Git hash commit: ba4175bf5b4467bf0fbf89a3fd645cceef7f7c23
- Docker version: Docker 20.10.14
- Are you using Docker Swarm or Kubernetes: Not using any of them
- Operating System and version: Ubuntu 20.04 (WSL2 for Windows 11)
Hi @naourass
That is architecture solution that had lots of discussions in the past. IDs you see in client are clientID, they are not constant (they are assigned incrementally when open annotation page). Also each object has server ID that received after the object was saved for the first time. You do not see them, but these IDs are kept.
It would be impossible to keep client ID because we do not strict parallel annotation process somehow within one job .
@bsekachev Thanks for letting me know that it's a dev decision. I may take some time and inspect the code architecture further to see if I can find any reliable workaround for special use cases like mine.
@bsekachev Could you please give me a guideline or source to understand the underlying reason of overwriting the original ids (and the order) when uploading an annotation?
If I need to preserve the original id of the annotation (for traceability purposes, for example), how can I do that? Is there any other field to place this original id / order? Thanks in advanced
@aelkin
The root reasons because we do not keep original ids I believe: these IDs are primary keys in the database, so it would cause lots of issues if we tried to keep them. Also annotations compatibility between different CVAT instances is important (I mean we need to be able to dump annotations from one CVAT instance and upload it to another CVAT instance what generally would be impossible). And what's more we support multiple annotations formats where these IDs are not assumed to be according to the formats specification.
You can try to save original IDs as an attribute, but I would say there are not convenient way to get these IDs. If it is important, it might be a feature request, like automatic creation of an attribute with server ID when saving objects on the server. So, in this case you would be able to trace objects.
I do have a lot of issues with annotations orders. I have 7 figures containing 18 annotations in each. After saving and refreshing they are all reordered in way that I have not figured out its logic. Has there been any solutions to this? Thanks!