[GSoC2024]Import annotations keeping current ones(#4747) #7771
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request keeps the current annotations without deleting them when new ones are imported, joining the current ones with the new ones.
Motivation and context
This change is linked to issue #4747, and it arises from the need to preserve the current annotations instead of deleting them when new ones are imported. Now, in the annotations import window, there will be an option to keep the current annotations or not to keep them. To achieve this, the mentioned switch option has been added in the import window, and also a new API flag is created, which takes the value of the switch and forwards it to the backend logic, where it is processed and, if true, does not delete the current annotations.
How has this been tested?
I have manually tested importing annotations with different formats and types, including having current annotations of all possible types to cover all possible cases. It has also been tested when the "keep old annotations" option is not checked, and in all cases, it works correctly.
As for the code tests, if the current tests run successfully, it means that the new functionality of not deleting the annotations works correctly, as this is True by default. I am currently working on coding the tests to verify that importing also works when the current annotations are deleted.
Checklist
develop
branch(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
The test checkbox has not been checked due to the explanation provided in the previous section. I will mark it once the coded tests are developed.
License
Feel free to contact the maintainers if that's a concern.