cvat
cvat copied to clipboard
Enhance Annotation Layer Changes: Relative zOrder Updates
Motivation and context
Closes #9064 The current method of moving objects in CVAT using absolute placements (sending them directly to the front or back) can be disorienting and unpredictable. When repeatedly moving an object backward, it can continue to shift unexpectedly, making it difficult to track and control its position accurately.
This update introduces a relative movement approach, allowing users to adjust an object’s z-order one layer at a time. Instead of jumping directly to the back or front, users can precisely move objects step-by-step, ensuring greater accuracy and control over the annotation layout. This prevents unwanted drastic changes and makes object layering more intuitive and predictable.
By constraining the movement within minZLayer and maxZLayer, this solution also prevents objects from going out of bounds, further improving usability.
How has this been tested?
I had tested by rebuilding and using the functionality for my semantic segmentation tasks. Just by testing the keybinds and buttons in multiple images.
Checklist
- [x] I submit my changes into the
developbranch - [x] I have created a changelog fragment
- [x] I have updated the documentation accordingly
- [x] I have added tests to cover my changes
- [x] I have linked related issues (see GitHub docs)
License
- [x] I submit my code changes under the same MIT License that covers the project. Feel free to contact the maintainers if that's a concern.
Would this kind of change need a test? I did not find any tests for the previous implementation.
Hi,
Moving objects between layers could be a useful feature. However, I don’t think we should completely remove the To Background and To Foreground functions. What do you think about adding additional shortcuts or buttons to support moving objects between layers?
An e2e test would be much appreciated. You can find basic tests for z order here
That makes sense. I will try to fix that and write the tests. Thank you!
Any updates on this?
Sorry for the delay, school had gotten busy. I updated the code. I will work on the e2e tests.
I’m having trouble writing a test for the toForeground button. When clicked, the button creates a new layer on top, but I can’t figure out how to move the slider in Cypress to reveal that layer.
I’ve tried: • Simulating button clicks to move the slider • Setting the current z-value using JavaScript • Clicking the bottom of the slider
None of these approaches have worked. If anyone has suggestions, I’d really appreciate the help!
Everything should be working now. All tests are passing.
What icons would be preferred for the two new buttons? Also, I forgot to mention I added E2E tests for the existing toForeground and toBackground buttons.
As for the icons, I would suggest using something like a box with an arrow pointing up and down, respectively. Or maybe just an arrow. However, I believe the first option would be better.
The proper key bindings should be working now. Is there anything else I should update? @klakhov
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
@klakhov @bsekachev @nmanovic — Is anything else needed before final review and merge?
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 73.43%. Comparing base (a7c13b2) to head (3332e2f).
Additional details and impacted files
@@ Coverage Diff @@
## develop #9063 +/- ##
===========================================
- Coverage 82.25% 73.43% -8.83%
===========================================
Files 467 411 -56
Lines 48648 45616 -3032
Branches 4091 4091
===========================================
- Hits 40016 33496 -6520
- Misses 8632 12120 +3488
| Components | Coverage Δ | |
|---|---|---|
| cvat-ui | 77.27% <ø> (+0.07%) |
:arrow_up: |
| cvat-server | 70.15% <ø> (-15.93%) |
:arrow_down: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Quality Gate passed
Issues
2 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code