-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix two problems with the task segmentation algorithm #7681
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. When a task has non-zero overlap and exactly as many frames as needed to create 1 or more complete segments, the current algorithm generates a redundant segment at the end. For example, if size is 5, segment size is 3, and overlap is 1, it generates segments (0, 2), (2, 4), and (4, 4). The algorithm attempts to compensate for this, but it only works in the case where the segment size is unspecified (and defaults to the total size). Update the algorithm to handle this correctly in the general case. 2. The algorithm selects a default overlap size of 5 if the media file is a video. However, this might not be a valid value if the task has a very small segment size. In this case, a range of undesirable behaviors may occur, depending on the segment size: * segments getting generated such that more than 2 segments cover a single frame; * task creation crashing with an exception; * a task being created with no segments at all. Fix this by clamping the default overlap size the same way as a user-specified one.
SpecLad
force-pushed
the
segmentation-fix
branch
from
March 26, 2024 11:39
0478408
to
8e1faa2
Compare
SpecLad
force-pushed
the
segmentation-fix
branch
2 times, most recently
from
March 26, 2024 13:35
7b29a43
to
6676f99
Compare
SpecLad
force-pushed
the
segmentation-fix
branch
from
March 26, 2024 13:58
6676f99
to
c700dbc
Compare
nmanovic
approved these changes
Mar 26, 2024
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.
LGTM
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #7681 +/- ##
===========================================
- Coverage 83.46% 83.39% -0.07%
===========================================
Files 373 373
Lines 39716 39716
Branches 3741 3741
===========================================
- Hits 33150 33123 -27
- Misses 6566 6593 +27
|
g-kartik
pushed a commit
to g-kartik/cvat
that referenced
this pull request
Mar 29, 2024
1. When a task has non-zero overlap and exactly as many frames as needed to create 1 or more complete segments, the current algorithm generates a redundant segment at the end. For example, if size is 5, segment size is 3, and overlap is 1, it generates segments (0, 2), (2, 4), and (4, 4). The algorithm attempts to compensate for this, but it only works in the case where the segment size is unspecified (and defaults to the total size). Update the algorithm to handle this correctly in the general case. 2. The algorithm selects a default overlap size of 5 if the media file is a video. However, this might not be a valid value if the task has a very small segment size. In this case, a range of undesirable behaviors may occur, depending on the segment size: * segments getting generated such that more than 2 segments cover a single frame; * task creation crashing with an exception; * a task being created with no segments at all. Fix this by clamping the default overlap size the same way as a user-specified one. Fixes cvat-ai#7675.
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation and context
When a task has non-zero overlap and exactly as many frames as needed to create 1 or more complete segments, the current algorithm generates a redundant segment at the end. For example, if size is 5, segment size is 3, and overlap is 1, it generates segments (0, 2), (2, 4), and (4, 4).
The algorithm attempts to compensate for this, but it only works in the case where the segment size is unspecified (and defaults to the total size).
Update the algorithm to handle this correctly in the general case.
The algorithm selects a default overlap size of 5 if the media file is a video. However, this might not be a valid value if the task has a very small segment size. In this case, a range of undesirable behaviors may occur, depending on the segment size:
segments getting generated such that more than 2 segments cover a single frame;
task creation crashing with an exception;
a task being created with no segments at all.
Fix this by clamping the default overlap size the same way as a user-specified one.
Fixes #7675.
How has this been tested?
Unit tests.
Checklist
develop
branch[ ] I have updated the documentation accordingly[ ] I have increased versions of npm packages if it is necessary(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.