-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fixing import and export issues with invalid tracks #8553
Changes from 8 commits
d944c8d
85ca560
cbe1cac
35674dd
3ae9a00
2f8f72a
a94f5eb
2ea5e79
8d76235
0c27398
13c559a
0d429d0
1e35536
2ec6756
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
### Fixed | ||
|
||
- Track shape duplication on import | ||
(<https://github.com/cvat-ai/cvat/pull/8553>) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,7 +131,8 @@ def filter_track_shapes(shapes): | |
if last_key >= stop and scoped_shapes[-1]['points'] != segment_shapes[-1]['points']: | ||
segment_shapes.append(scoped_shapes[-1]) | ||
elif scoped_shapes[-1]['keyframe'] and \ | ||
scoped_shapes[-1]['outside']: | ||
scoped_shapes[-1]['outside'] and \ | ||
(len(segment_shapes) == 0 or scoped_shapes[-1]['frame'] > segment_shapes[-1]['frame']): | ||
segment_shapes.append(scoped_shapes[-1]) | ||
elif stop + 1 < len(interpolated_shapes) and \ | ||
interpolated_shapes[stop + 1]['outside']: | ||
|
@@ -950,6 +951,9 @@ def propagate(shape, end_frame, *, included_frames=None): | |
break # The track finishes here | ||
|
||
if prev_shape: | ||
if curr_frame == prev_shape["frame"]: | ||
if dict(shape, id=None, keyframe=None) == dict(prev_shape, id=None, keyframe=None): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These 2 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They can be combined, but then this line becomes too long (137 cahracters) and should be split to 2 lines anyway, and I think it is more readable the way it is now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
if (
condition1
and condition2
):
... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, combined them |
||
continue | ||
assert curr_frame > prev_shape["frame"], f"{curr_frame} > {prev_shape['frame']}. Track id: {track['id']}" # Catch invalid tracks | ||
|
||
# Propagate attributes | ||
|
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.
Now there should be no errors during export tracks with duplicated shapes. Why not mention that?
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.
rewritten it a bit