-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove empty masks #7295
Remove empty masks #7295
Conversation
… into kl/remove-empty-masks
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #7295 +/- ##
===========================================
- Coverage 83.24% 83.18% -0.07%
===========================================
Files 373 373
Lines 39615 39693 +78
Branches 3701 3713 +12
===========================================
+ Hits 32977 33018 +41
- Misses 6638 6675 +37
|
I belive everything is consistent.
We have the same logic for all shapes in checkNumOfPoints function. If I try to create rect with <4 points then an errror occurs
If I try to set rectangle to <4 points and save it then the same exeption is thrown. Is there even a way to create such case for other shapes than masks?
Fixed the message. |
How can you create/edit a rectangle setting it less then 4 points? |
Yes, we have such check in cvat-core But The idea is to prevent useless exception when user does something wrong. |
I believe locking polygon-minus and eraser tool if mask is empty in cvat-canvas would be a good solution in first. Finally if a user created an empty mask in cvat-canvas, it should not raise shape.drawn event |
Using cvat-core api via code.
Okay, ill think about that |
cvat-core/src/annotations-objects.ts
Outdated
const redo = (): void => { | ||
stashedPoints = []; | ||
for (const object of Object.values(updatedObjects)) { | ||
const points = mask2Rle(masks[object.clientID]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be a problem with huge memory consumption
In closure it refers to variable masks
that contains all unpacked masks stored on the frame (imagine that there are 100+ masks per frame).
And undo/redo stores up to 128 actions as far as I remember
It gigabytes of data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
masks
store not all masks on the frame but only affected ones, but still there can be a problem.
Ive added limitations to annotation history, so there only can be 20
undos for removing underlying pixels. (maybe we should change this number to even lower value)
… into kl/remove-empty-masks
The issue with copying mask that was changing class seems to be reproducible on develop, its separate bug but Ive fixed it. I cant really reproduce the issue with color changing on last verion of PR, so maybe its fixed already. |
Motivation and context
This PR improves CVAT behavior in case of appearing empty masks.
remove underlying pixels
feature, empty masks are now deleted and special notification is shown:remove underlying pixels
eraser
andpoly-minus
tools are blockedDel
/Remove
actions)Fixed bug with copying masks which lead to changing label.
Resolved #7160
How has this been tested?
Checklist
develop
branch(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.